Use of CSS Display

Asked

Viewed 36 times

1

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

The question:

The excessive use of display:none can affect the system in some way?

Remembering that are sites that rarely suffer from maintenance.

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 feature expense, since it will be sent to the user regardless of its 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 minimal version (min), which reduces file size by facilitating access to it and decreasing bandwidth consumption.

For large websites with many accesses this reduction has significant impact, in the same way as for customers who use smartphones with mobile internet.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.