Pages

Saturday, June 26, 2010

:: HTML Elements Part 3 ::

Normally when you create html pages , there will be have more than one paragraph and one line in a html page. So , its necessary for you to know how to make new paragraphs , new lines and break lines.

HTML Paragraph

Paragraphs are defined with the <p> tag. Do not forget the end / closing tag (</p>) . Most browsers still can display HTML correctly even if you forget the end / closing tag . But forgetting the end / closing tag can produce unexpected results or errors. For the future version of HTML will not allow you to skip the end / closing tag.

For example :

<html>
<head>
<title> The third lesson </title>
</head>
<body>
<p> This is the exampe using HTML Paragraph </p>
</body>
</html>

HTML Line Breaks

Use the <br/> tag if you want a line break (a new line) without starting a new paragraph. The tag does not have any HTML element. It has no end tag . Besides that , you can use <br> tag . Both tags will be used depend on situations . If you want to break the line , you will use <br/> tag. But if you want to use new line , you will use <br> tag . In XHTML , XML and future versions of HTML , HTML elements with no end tag or closing tag are not allowed. Even if <br> always work in all browser , writing <br/> instead is more future proof.

For example :

<html>
<head>
<title> The third lesson </title>
</head>
<body>
<p> This is the exampe using HTML Paragraph </p>
<br> This is the exampe using HTML Line Breaks <br/>
</body>
</html>

Now , you already learned and know about HTML Paragraph and Line Breaks.

0 comments: