Let's say we have a page with the some simple HTML/CSS like below. Does the browser also read .b
and .c
in the stylesheet?
HTML
<div class="a">1</div>
<div>2</div>
<div>3</div>
CSS
.a { color: aqua; }
.b { color: blue; }
.c { color: cyan; }
That is just an example, but in the real world there might be hundreds, thousands lines of CSS code isn't being used, such as using Bootstrap for a very very small project.
Yes all the rules are loaded in the memory, this is why when you add new element to your DOM (e.g. by using javascript) you see that the style automatically applies to them.
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