3.3 CSS Rules
The way CSS works is that CSS rules are applied to elements within a web page. Browsers determine which elements to apply the CSS rules to with the help of selectors. There are quite a few different types of selectors. For now, we’ll introduce type selectors and the universal selector. Type selectors are very popular. The universal selector is not as popular, but it’s important to understand it because you’ll see it referred to on various websites, including the W3C’s CSS website at https://www.w3.org/Style/CSS.
With a type selector, you use an element type (e.g., hr) to match all instances of that element type and then apply specified formatting features to those instances. For example, the following CSS rule uses a type selector ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access