Empowering Today’s Learners to Become Tomorrow’s Leaders
It is time to add some more text to the page.
Remove all of the content within your opening and closing body tags.
Then, starting after your opening body tag, type:
This is my first Web page. Then, hit enter on your keyboard and type:
Isn't it cool!
2. Save and preview in a browser
(click the refresh/reload button to update the page and view your changes)
Notice the browser displays the new text on the same line as “This is my first Web page.” Even though Notepad displays the two codes on separate lines, the browser will display them on the same line.
With HTML, you must indicate separate paragraphs by using the paragraph element p.
3. Return to Notepad and place <p> tags around This is my first Web page and Isn't it cool! as shown below in red:
<!doctype html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<p>This is my first Web page.</p>
<p>Isn't it cool!</p>
</body>
</html>
4. Save and preview in the browser
(click the refresh/reload button to update the page and view your changes)
The paragraph tag <p> at the beginning of a line will display a line space above the line in the browser, and a </p> tag at the end of a line will display a line space below the line in a browser.
Note: The p element is also known as a block-level element. There are numerous block-level elements in HTML.
Find out more at http://htmlhelp.com/reference/html40/block.html
Block-level elements are also known as containers or boxes. The concept of block-level element s/containers/boxes is very important when we move into CSS.
A block-level element can contain content. The opening and closing tags define the block/container/box.
Therefore the p element requires an opening <p> and closing tag </p>.