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

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.

“Elements in HTML have attributes ; these are additional values that configure the elements or adjust their behavior in various ways to meet the criteria the users want.”
The source and a quite useful list:
HTML attribute list

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.

1 Like