Is it ok to hide any thing temporarily or forever using display:none
? in dynamic site where many component of page coming from different plugins etc and many time if client doesn't want any thing on page then i use dispaly:none
to hide things from page . I do not remove thing from actual source because client can come back ask to enable that thing again.
so what are pros and cons to keep things hide from display:none if i keep any element hide using Display:none
forever?
is there any cons in terms of SEO, Screen reader, Accessibility etc?
If the client wants it removed, then create a backup of the page, and post a page that actually has it removed. Don't substitute CSS for actually removing an item. If they decide they want it in the future, then go in and swap your backup for your live copy. If you're dealing with dynamic output (in the case of PHP or a comparable technology) you could stop that particular output with comments so they're never included in the response.
Pros: Very easy to do
Cons:
You can simply "comment" these section server side to save a lot of processing on the server, bandwidth, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With