Forum Academy Marketplace Showcase Pricing Features

Displaying element with CSS

I’m using ToDesktop to create a web app. There is an element that I only want to display in the app. I’ve been able to hide an element using CSS, but can’t find a way to do show one.

This is the CSS code I used to hide an element:

html.todesktop #displaytodesktoptoolbar {
display: none;
}

Tried to use “display: inline” to display an element, but didn’t work. Was trying many others as well, but no luck. Any ideas?

1 Like

Hi
This code you wrote defines a CSS rule, but if you want to hide elements while working with app, you’d better use JavaScript.
if you want put the code in a custom HTML, copy and paste this:

<script>
document.querySelector('html.todesktop #displaytodesktoptoolbar').style.display = 'none';
</script>

Thanks for the reply! The CSS for hiding elements works, but I’m looking to show an element only in the web app. Can I do that with JavaScript?

Oh, sorry, I forgot.
Yes, write the same code, only use ‘block’ instead of ‘none’.
or one of these options (just the property inside ‘…’)

display: block;
display: inline;
display: inline-block;
display: flex;
display: inline-flex;
display: grid;
display: inline-grid;
display: flow-root;