January 2018
Intermediate to advanced
678 pages
20h 16m
English
style Attribute, style Containerstyle AttributeThe style attribute is at the top of Figure 3.8’s cascading CSS rules list; as such, when you use the style attribute for CSS rules, those rules are given the highest priority. Here’s an example element that uses a style attribute:
<h2 style="text-decoration:underline;">Welcome!</h2>
As you can see, using the style attribute lets you insert CSS property-value pairs directly in the code for an individual element. So the preceding h2 element—but no other h2 elements—would be rendered with an underline.
The style attribute is a global attribute, which means it can be used with any element. Even though it’s legal to use it with every element, and you’ll see it used in lots of legacy code, ...
Read now
Unlock full access