We've seen earlier that a web browser will ignore all of the CARRIAGE RETURNS typed into your text editor. But, wherever a browser sees the paragraph tag, it inserts a blank line and starts a new paragraph. The HTML code for forcing a paragraph break is:
<p>
Note that this tag is special in that it does not require an ending tag; for now you do not need to use:
</p>
In a later lesson we will see why we want to use <p> a closing </p> for the more current HTML coding standards. For basic HTML coding, let's keep it simple for now.
Also, the <h> tags have a built in break so it is unnecessary to put <p> tag before a header tag:
<p> <h2>Blah Blah Blah Blah</h2>
Follow the directions below to insert and view a paragraph break in your HTML document.
Volcanoes have been a part of earth's history long before humans. Compare the history of human beings, a few million years in the making, to that of the Earth, over four billion years in the making.
<p>This section should now look like:
<h2>Introduction</h2> A volcano is a location where magma, or hot melted rock from within a planet, reaches the surface. It may happen violently, in a massive supersonic explosion, or more quietly, as a sticky, slow lava flow. <p> Volcanoes have been a part of earth's history long before humans. Compare the history of human beings, a few million years in the making, to that of the Earth, over four billion years in the making.
To separate major sections of a web page, use the horizontal rule or hr tag. This inserts a straight line like you see right above the heading for this section.
The HTML format for a horizontal rule tag is:
<hr>
Let's try it now! Put an hr tag above the Introduction heading. This will help to separate the opening sentence of the lesson from the other portions that will follow.
And finally, there is the <br> tag which forces text to a new line like the <p> tag, but without inserting a blank line. You might use this tag when making a list of items, when writing the lines of a poem, etc. Compare the differences between using the <br> and <p> in these two examples:
Paragraph <p> tags Only | |||
---|---|---|---|
HTML | Result | ||
And then, we could all see at once the brilliant purpose of the paragraph tag. <p> Moving on... <p> the more tags you write, the better you will feel? |
|
Paragraph <p> and Line Break <br> tags | |
HTML | Result | ||
And then, we could all see<br> at once the brilliant purpose<br> of the paragraph tag. <p> Moving on... <br> the more tags you write,<br> the better you will feel? |
|
The <br> tag can be used for a different layout style for your section headings. If you notice, the header tags <h1>, <h2>, ... automatically insert white space above and below the text of the header tag. Some web page authors prefer a style that controls this white space.
Section titles with Header Tags | |||
---|---|---|---|
HTML | Result | ||
and in the end it was all for naught. <h4>The New Cheese Edict</h4> Later, sir Longhorn declared that all makers of cheese would have to be certified before commencing production. |
|
Section titles with <b> and <br> tags NOTE! The <b> tag is covered in the next lesson but all it does is make the text bold. |
|
HTML | Result | ||
and in the end it was all for naught. <p> <b>The New Cheese Edict</b><br> Later, sir Longhorn declared that all makers of cheese would have to be certified before commencing production. |
|
The difference may seem trivial now, but it opens up possibilities when later we learn to create text of different size and color for our section headings. Lesson Index | previous: "Headings" | next: "Styled Text" |