Today you will learn about html paragraphs in detail:
Documents in html are divided into paragraphs.Html Paragraphs:
<p> elementin html defines paragraph
Example:
Browsers automatically starts new line before and after paragraph.
Html Display:
You can ever be sure about how Html will be displayed.Resized window,large or small screen will create different results.In html you cannot change output by adding spaces or extra line in your html code.Extra spaces and extra lines will be removed by browser in your html code.In html spaces are counted as only one space.
Example:
But when you will open this is browser it will be written in same line spaces will be ignored
by browser.
Make Sure End Tags Are Not Missing:
Most browser display html correctly even you have forgotten end tags:Example:
Above example will work in most browser but will notwork in all browser,
Forgetting end can produce unexpected result.
Html Line Breaks:
<br> element defines line break in html.<br> is used when you want to break line (a new line) without starting new paragraph.
Example:
<br> element is an empty Html element it has no end tags.
Poem Problem:
When you write poem in pragraph,it will not be written in poem form it will be in paragraph.Example:
It will be displayed in browser like this
Html <pre> Element:
<pre> element in html defines preformatted text.Text insiide <pre> element is displayed in a fixed width format abnd it preserves both spaces and line breaks.
Example:
Now in browser you will see like this
No comments:
Post a Comment