DEV Community

Spruce Emmanuel
Spruce Emmanuel

Posted on

Display: none; worsen or improve website performance?

webDevs does display: none; worsen website performance or improves it. 👇👇

Top comments (5)

Collapse
 
jensandersenwu profile image
Jens Andersen

I don't think it worsens accessibility, when used correctly. Example: I have a Responsive Website where logo is changing with srcset in picture-tag and I use display:none for the pages where the logo is not to be shown in the flow of the page. I can't imagine any other way to do that as easy as with display:none in the specific css for those pages.

Collapse
 
mikemai2awesome profile image
Mike Mai

It worsens accessibility.

Collapse
 
spruceemma profile image
Spruce Emmanuel

Accessibility: I think it depends on how it is used

Collapse
 
mikemai2awesome profile image
Mike Mai

Absolutely, it is one of the most mis-used CSS props.

Thread Thread
 
spruceemma profile image
Spruce Emmanuel

I totally agree