Thursday, 24 September 2015

Paragraph


HTML Paragraphs

 

<p> element defines  a paragraph.

Example:
<p> Hello world!</p>
<p> This is a paragraph</p>


The text in HTML files are displayed in browsers with only one space even if you place multiple spaces and new lines. Which will be a problem since we'll never know how they will be displayed in other computer in the screen is small or large screen and resized browser.

Try this:

<p> this a paragraph the that has a         multiple     spaces       between   words     and
with


mulitple



new lines </p>




Fixing the problem

 

 Line  Break

The <br>  element defined as line break.
You can use <br> if you want a line break or new line without creating an new paragraph.

Try this:

<p> This is a paragraph with a line break <br>
This element is use to create new line without making a new paragraph.</p>


Preformatted Text 

The <pre>  element defines preformatted texts.
The text inside the <pre> element is displayed in fixed width font and preserve line breaks and spaces.

Try this:

<pre> The     quick brown fox jumps over the lazy dog,
The quick      brown fox jumps over the lazy dog,
The quick brown      fox jumps over the lazy dog,
The quick brown fox     jumps over the lazy dog,
The quick brown fox jumps      over the lazy dog. </pre>


You will notice that text will be displayed with multiple spaces and also with line breaks with using any elements.



*paste them in the body of .html file

No comments:

Post a Comment