Answer the question
In order to leave comments, you need to log in
How bad will it play on performance if I hide a large block with display none?
There is this markup:
<header class="header">
<nav class="nav">
<div class="link">
<div class="link__content">Content</div>
</div>
<div class="link">
<div class="link__content">Content</div>
</div>
<div class="link">
<div class="link__content">Content</div>
</div>
<div class="link">
<div class="link__content">Content</div>
</div>
</nav>
</header>
display: none
. display: none
is not critical (including on mobile phones)?
Answer the question
In order to leave comments, you need to log in
To add / hide something through JS, you need to store it in JS. Storing something in JS is more expensive than
storing data of similar weight in HTML. In addition, when performing state synchronization with the DOM and rendering, resources are also wasted.
Write through and everyone will say "thank you" display: none;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question