Using the CSS Display

1

I noticed that I've been using a lot of display:none to remove blocks of code from a page. I do this on instructions from superiors, but I have always believed that it is a practice that can affect the performance of the websites developed.

The question:

Can excessive use of display:none affect the system in any way?

Remembering that they are sites that rarely suffer from maintenance.

    
asked by anonymous 26.08.2016 / 16:47

1 answer

2

The display: none itself does not affect the performance of the site since the css is processed by the client and not the server, however the hidden content is rather a resource waste, since it will be sent to the user regardless of the use.

This overhead can affect both the company's costs and the customer's minimum requirement. It is a common practice in CSS and JS to make use of the min (min) version, which reduces the size of the file by easing access to it and decreasing bandwidth consumption.

For large sites with many hits this reduction has a significant impact, just as for customers using smartphones with mobile internet.

    
26.08.2016 / 17:03