The align attribute specifies the horizontal alignment of an element's content. Everything inside that element will align.
At the bottom of this page there is a code editor pre-loaded with the lesson's code.Here are the possible values for the align attribute:
✶ left: Aligns element to the left.
✶ right: Aligns element to the right.
✶ center: Centers the element.
✶ justify: Each line will be equal length, like a newspaper.
<p align = 'center'> This is a centered paragraph. The align attribute is equal to center. </p>
➼ <p>
Paragraph Element
➼ align = 'center'
The paragraph's content will be centered.
➼ Element's Content
➼ </p>
End Paragraph
<p align = 'justify'> This is a justified paragraph. The align attribute is equal to justify. </p>
➼ <p>
Paragraph Element
➼ align = 'justify'
The paragraph's content will be justified.
➼ Element's Content
➼ </p>
End Paragraph
Img elements have an HTML align attribute. This can be used to enchance your page's appearance.
<img src="image.gif" align="middle">
➼ src
- Image location
➼ align
- The image aligned middle.