OUTPUT
FIGURE 6.9 RULE LINES WITHOUT SHADING.
LINE BREAK
The <hr> tag breaks a line of text at the point where it appears. When a web browser encounters a <br> tag, it restarts the text after the tag at the left margin (whatever the current left margin happens to be for the current element). You can use<br> within other elements, such as paragraphs or list items; <br> won’t add extra space above or below the new line or change the font or style of the current entity. All it does is restart the text all the next line.
CLOSING SINGLE TAGS PROPERLY
Like the <hr> tag, the <br> tag has no closing tag in HTML. To convert this tag to XHTML and to ensure compatibility with HTML browsers, add a space and forward slash to the end of the tag and its attributes, as shown in the following example:
And then is heard no more: it is a tale <br/>
Told by an idiot, full of sound and fury, <br/>
Signifying nothing, </p>
The following example show a simple paragraph in which each line (except for the last, which ends with a closing <p> tag) ends with a <br/>
INPUT
<p> tomorrow, and tomorrow, and tomorrow, <br/>
Creeps in this petty pace from day to day,<br/>
To the last syllable of recorded time; <br/>
And all our yesterdays have lighted fools<br/>
The way to dusty death. Out, out, brief candle! <br />
Life’s but a walking shadow; a poor player, <br/>
That struts and frets his hour upon the stage, <br/>
And then is heard no more: it is a tale<br/>
Told by an idiot, full of sound and fury, <br/>
Signifying nothing. </p>
Figure 6.10 shows how it appears in browsers.
NOTE
Clear is an attribute of the <br>tag. It’s used with images that have text wrapped alongside them. You’ll learn about this attribute in lesson 7,”adding images, color, and backgrounds,”
No comments:
Post a Comment