HTML Attributes
Attributes provide additional information about an element or a tag, while also modifying them.
Most attributes have a value.
In this example, the value of "center" indicates that the content within the p
element should be aligned to the center:
Attribute Measurements
As an example, we can modify the horizontal line so it has a width of 50 pixels. This can be done by using the width attribute:
An element's width can also be defined using percentages:
The Align Attribute
The align attribute is used to specify how the text is aligned. In the example below, we have a paragraph that is aligned to the center, and a line that is aligned to the right.