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.
Aligns the paragraph flush with the left margin.

Center - Center alignment/justification.
Aligns the paragraph center to your page.

Right - Right alignment/justification.
Aligns the paragraph flush with the right margin.

Justify - Double justification. Aligns the paragraph flush with both the right and left margins.
Throughout the world, ancient forests are in crisis. Many of the plants and animals that live in these forests face extinction. And many of the people and cultures who depend on these forests for their way of life are also under threat. But the news is not all bad. There is a last chance to protect these forests and the life they support. visit → www.greenpeace.org

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">
The production, trade, use, and release of many synthetic chemicals is now widely recognised as a global threat to human health and the environment. visit → www.greenpeace.org</p>



 
  back ↑