Text alignment is the capability to arrange a block of text, such as a heading or a paragraph, so that it’s aligns the left margin (left justification, the default), aligned against the right margin (right justification), or centered. Standard HTML 2.0 has no mechanisms for aligning text; the browser is responsible for determining the alignment of the text *(which means most of the tie is left-justified).
HTML 3.2 introduced attributes for text and element alignment, and these attributes have been incorporated into all the major browsers. HTML 4.01 still supports alignment attributes, but the preferred method of controlling text alignment now is with style sheets.’
ALIGNING INDIVIDUAL ELEMENTS
To align an individual heading or paragraph,. Include the align attribute in the opening tag. Align has four value: left, right, center, or justify,. Consider the following examples in the code snippet that follows.
The following input and output example shows the simple alignment of several headings. Figure 6.134 shows the results.
INPUT
<h1 align=”center”> Northridge paints, inc, </h1>
<p align=”center”>we don’t just paint the town red. </p>
<h1 align=”left”> serendipity products </h1>
<h2 align =”left”> <a href=”who.html”>who we are</a></h2>
<h2 align =”left”> <a href=”products.html”>what we do</a></h2>
<h2 align =”left”> <a href=”contacts.html”>how to reach us </a></h2>
OUTPUT
FIGURE 6.13 HEADINGS WITH VARYING ALIGNMENTS.
No comments:
Post a Comment