I'd assume that this would be faster:
#dialog .videoContainer { width:100px; }
than:
.videoContainer { width:100px; }
Of course disregarding that .videoContainer
in the first example would only be styled under the #dialog
tag.
HTML (the Hypertext Markup Language) and CSS (Cascading Style Sheets) are two of the core technologies for building Web pages. HTML provides the structure of the page, CSS the (visual and aural) layout, for a variety of devices.
CSS stands for Cascading Style Sheets, and it's used to add style to a web page by dictating how a site is displayed on a browser. CSS is unique in that it doesn't create any new elements, like HTML or JavaScript. Instead, it's a language used to style HTML elements.
CSS (Cascading Style Sheets) is a language for styling the webpage. We can change the appearance and the layout of the webpage by using CSS. We can also define how a website's view changes in different screens like desktops, tablets, and mobile devices. CSS is not a programming language, like C++ or JavaScript.
CSS selectors are matched from right to left.
Therefore, .videoContainer
should be "faster" than #dialog .videoContainer
because it misses out testing for #dialog
.
However, this is all irrelevant at best - you'll never notice the difference. For normally sized pages, the amount of time we're talking about is so insignificant as to be nonexistent.
Here's a relevant answer by an expert that you should read: Why do browsers match CSS selectors from right to left?
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