Aligning Text


There are five basic alignment options available: Default (No Alignment Specified), Align Left, Align Center, Align Right, and Justify. Default is usually (depending on the browser defaults) the same as Align Left. These options specify the horizontal alignment of an element in relation to the container, which is an item that encloses other elements, such as an entire page or a paragraph.

In index.html, position the insertion point in the Yoga Sangha header at the top of the page Click the Align Center button in the Property inspector.

The heading is now centered. Any paragraph formatting that you apply to a text block, such as headings or alignments, affects everything contained within that paragraph.

Best Coding Practice: Deprecation of the Align Attribute

As of HTML 4.01 the align attribute has been deprecatedmeaning it is marked for deletion by the W3C. The align attribute appears in the tag of the corresponding block element in the following manner:

 <h1 align="center">Yoga Sangha</h1> 


Likewise, specifying alignment directly in a div (the <div> tag is a type of structural markup, often used in conjunction with CSS, which is used to define sections of a document)is also deprecated, as shown in the following example:

 <div align="right"> 


The best way to align elements, such as text and graphics, in your pages is through the use of CSS. Whenever possible, use CSSand avoid using the four alignment options that are available in the Property inspector because they use the align attributeto create the most efficient pages that are up to current standards.

Using CSS is covered in Lesson 4; working with code is covered in Lesson 16.





Macromedia Dreamweaver 8(c) Training from the Source
Macromedia Dreamweaver 8: Training from the Source
ISBN: 0321336267
EAN: 2147483647
Year: 2006
Pages: 326

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net