This exercise talks about the style attribute. What is an attribute?


#1

Question

This exercise talks about the style attribute. What is an attribute?

Answer

Within this context, an attribute is a means of extending an HTML element so that developers can modify the behavior or provide metadata about that element. Attributes are always included within the opening tag of an HTML element like so:

<h1 style=”font-size: 18px;”>

The style attribute allows us to define CSS rules on an element but there are countless other attributes an HTML element can have. For some context here, check out Mozilla docs for a complete list of HTML attributes.


FAQ: Learn CSS Selectors Visual Rules - CSS Setup Selectors - Inline Styles