HTML Paragraphs
Most Browsers automatically add an empty line before and after paragraph
HTML Line Breaks
<br/> element is an empty HTML tag.
<html>
<body>
<p>This is <br/> a para- <br/> graph with line breaks</p>
</body>
</html>
In XML and future versions of HTML, HTML elements with no end tag (closing tag) are not allowed.
Even if <br> works in most browsers, writing <br/> instead is more future-proof and thus considered best practice.
HTML Output Tips
Resized windows will create different result.
You cannot change the output by adding extra space or extra lines in your HTML code.
The browser will remove extra space and extra lines when the page is displayed.
Any number of lines count as one space, and any number of spaces count as an one space
<html>
<body>
<p>
My Bonnie lies over the ocean.
My Bonnie lies over the sea.
My Bonnie lies over the ocean.
Oh, bring back my Bonnie to me.
</p>
<p>
Note that your browser ignores your layout!
</p>
</body>
</html>
<html>
<body>
<p>
This paragraph
contains a lot of lines
in the source code,
but the browser
ignores it.
</p>
<p>
This paragraph
contains a lot of spaces
in the source code,
but the browser
ignores it.
</p>
<p>
The number oflines in a paragraph depends on the size of your browser window.
If you resize the browser window, the number of lines in this paragraph will change.
</p>
</body>
</html>
Most Browsers automatically add an empty line before and after paragraph
HTML Line Breaks
<br/> element is an empty HTML tag.
<html>
<body>
<p>This is <br/> a para- <br/> graph with line breaks</p>
</body>
</html>
In XML and future versions of HTML, HTML elements with no end tag (closing tag) are not allowed.
Even if <br> works in most browsers, writing <br/> instead is more future-proof and thus considered best practice.
HTML Output Tips
Resized windows will create different result.
You cannot change the output by adding extra space or extra lines in your HTML code.
The browser will remove extra space and extra lines when the page is displayed.
Any number of lines count as one space, and any number of spaces count as an one space
<html>
<body>
<p>
My Bonnie lies over the ocean.
My Bonnie lies over the sea.
My Bonnie lies over the ocean.
Oh, bring back my Bonnie to me.
</p>
<p>
Note that your browser ignores your layout!
</p>
</body>
</html>
<html>
<body>
<p>
This paragraph
contains a lot of lines
in the source code,
but the browser
ignores it.
</p>
<p>
This paragraph
contains a lot of spaces
in the source code,
but the browser
ignores it.
</p>
<p>
The number oflines in a paragraph depends on the size of your browser window.
If you resize the browser window, the number of lines in this paragraph will change.
</p>
</body>
</html>
No comments:
Post a Comment