Saturday 23 November 2013

Chapter 5: Paragraphs

Chapter 5: Paragraphs


» HTML Paragraphs

The HTML tag is defined with the <p> tag.

EXAMPLE:

<p>HTML Paragraph.</p>


Result:


HTML Paragraph.


» ATTENTION:

Empty line will be automatically added before and after the paragraph.



» The End Tag


Don't forget the end tag. Most browsers will display HTML correctly even if you forget the end tag, but don't rely on it. But if you forget the end tag this can produce unexpected errors or results.

EXAMPLE:

<p>HTML Paragraph
<p>HTML Paragraph</p>

Result:


HTML ParagraphHTML Paragraph




» HTML Line Breaks

Use <br /> if you want to add line breake without starting new paragraph.

EXAMPLE:

<html>
<body>

<p>This <br />is<br /> HTML <br />line<br /> break.<p>

</body>
</html>

Result:


This

is
HTML
line
break.




» HTML Output Tips

Sometimes HTML is displayed in large or small screens by the web browsers, and resized windows will create different results.
HTML output cannot be changed by extra spaces or lines.The browser will remove all unnecessary spacings.

EXAMPLE:

<html>
<body>

<p>
   HTML Output Tips.
   HTML Output Tips!
   HTML Output Tips?
</p>

</body>
</html>

Result:


HTML Output Tips. HTML Output Tips! HTML Output Tips?


EXAMPLE 2:

<html>
<body>

<p>
  <This
   is HTML
   Output
   Tips.
</p>
<p>
   In this
   case the browser
   deletes the line
   breaks.
</p>

</body>
</html>

Result:


In this case the browser deletes the line breaks.

No comments:

Post a Comment