www.kdwebpagedesign.com
BASIC HTML ::
BASIC CSS ::
USER Tools ::
JavaScript Tricks ::
Other Information ::
Donations ::
Do you find our Tutorials helpful? Are the free Auction Templates helping your sales? Donations of any amount are appreciated to help keep this site up and running!
ONE-TIME DONATIONS:
$


MONTHLY DONATIONS:
$ for mths.
KD Web Page Design Tutorials

Paragraphs, Linebreaks and Horizontal Rules

The <p> tag is used to indicate paragraphs. You should not use empty paragraphs <p></p> to insert blank lines. Instead, use the <br> tag. You can also use the <hr> to visually separate sections on your Web page.

The <p> Tag and its Attributes

Paragraphs begin with <p> and end with the </p> tag. Although traditionaly it is not necessary to close the tag, the next version of HTML will not allow you to skip ANY closing tags. And if you do not close the tags, the formatting throughout the rest of page may not work as you would like. By adding the align="x" attribute you specify the paragraph alignment. The values include "right" and "center" with the default being "left".

<p align="left">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>

<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>

Linebreaks <br>

Using empty paragraphs <p></p> to insert blank lines is a bad coding. Use the <br> tag instead. The <br> tag is a stand alone tag used when you want to end a line, but don't want to start a new paragraph. The <br> tag forces a line break wherever you place it. Using two line breaks gives you the same paragraph spacing as starting a new paragraph. Attributes include clear="x" with the values being "left", "all", "right" and "none".

The code in the example below will give you the same visual effect as the code in the example above. It is better to use double linebreaks than starting a new paragraph if all the attributes are the same in both paragraphs.

<p align="left">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<br><br>
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>

Horizontal Rules <hr>

The <hr> tag is a stand alone tag (it does not require a closing tag) that you can use to visualy separate sections of text on your page. You can use certain attributes to modify the appearance of the horizontal rule. The attributes include width="x" (x being the value in either fixed width or percentage), size="x", align="x" (left, right or center) and noshade. Below is the code for these four horizontal rules:









<hr>

<hr noshade>

<hr width="200" size="3" align="left">

<hr width="50%" size="6" align="center">

To Top TO TOP