Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Is display none the right way to hide an element? Reply To: [Solved] Is display none the right way to hide an element?

#188626
shaneisme
Participant

display: none means it will be hidden AND removed from the flow of the website.

visibility: hidden means it will be hidden, BUT will remain in the flow of the website.

Essentially, visibility: hidden will not show the element, but will retain the space it takes up. Whereas display: none completely removes it.

But, when you’re talking about doing what you’re doing, it’s actually best to remove it in the code. You’re still processing and rendering the code, but you’re just hiding it in the styles which means you’re losing that performance (no matter how small that is, it still counts).