HTML CSS IMAGES LINKS | |||||
HTML → Paragraph alignment A number of basic tags allow an HTML page to be formatted, much in the same way that word processors format documents. As you know, the paragraph tag starts a new paragraph and is the equivalent of two <br> tags. Remembering to include the closing paragraph tag </p> is crucial both to the validity of the code as well as to the formatting of the page. An attribute provides a tag with further specification regarding the way it affects the display of content. The majority of attributes will be followed by an equal sign, followed by a numerical or textual value. Anything that appears immediately after an equal sign MUST BE EMBEDDED IN QUOTES. Attributes are placed in the opening section of a tag and do not appear in the closing section of that tag. Most browsers left-justify a new paragraph by default. To modify this behavior, HTML 4 and XHTML provide the align attribute for the <p> tag. The paragraph-alignment attribute (left, right, justify or center) defines the alignment of a paragraph on the screen. Specifically, the align attribute controls the horizontal position of text within the paragraph tag <p>. Left - Left alignment/justification.
Center - Center alignment/justification.
Right - Right alignment/justification.
Justify - Double justification. Aligns the paragraph flush with both the right and left margins.
Paragraph alignment can be manipulated by including one of the attributes within the <p> tag as shown below: HTML code: <p align="left"> This paragraph is left-aligned. </p> <p align="center"> This paragraph is center-aligned. </p> <p align="right"> This paragraph is right-aligned. </p> <p align="justify"> |
|||||
back ↑ |