Sub-menu

 

>> HTML > A Simple Page > Part Two

Title and Page Content

Content I have changed or added, appears as Bold text.

What

Adding a Title to your page and inserting more content.

Code

<html>
<head>
<title>This is my first webpage </title>
</head>
<body>
This is the first line of text<br>
And it ends in a Break tag - causing a Line-break.
<p>For line 3, we have made a Paragraph tag.</p>
<p>For line 4, we have made Paragraph tag.<br>
Included two Line-breaks (on lines 4 and 5).<br>
Then closed the Paragraph on line 6. </p>

</body>
</html>

Example

Title and content page - in a new window

How to do it

Continuing with the original code - if you closed the Notepad holding your code, locate it on your PC, 'Right-Click' and select 'Open with...' choosing Notepad from the list. With this option, copy the new code (from above) and paste it, in the right places, into your existing code.

Or you can copy the whole code (from the box), paste it into a blank NotePad document and "Save As..." page1.html.

Now find page1.html (where you saved it) and open it. It should open in a browser window (Internet Explorer / Firefox / etc.) and will look like the Example above.

Tip If you save every change with a new name i.e. page1.html, page2.html, etc. You can have a record of which code does what (for future reference).

What you have done

You have entered a Page Title 'This is my first webpage'. When you look at the webpage, in your browser, you will see the Title displayed in the blue Title Bar at the top of the page.

You have introduced a <br> tag. This causes a line-break, putting the next bit of content onto a new line. <br> tags are an exception to the Open:Close Rule. You place a single <br> tag to create a line-break and double <br><br> tags to create a double break. You do not need to close the tag in HTML.

In xHTML you need to declare line-breaks as self-closing <br />, but we do not need to worry about this for now.

You have also included a <p> paragraph tag which creates a block of content. <p> tags do need to be closed with </p> at the end of the content block.

<br> tags can be included within a paragraph.

<p> tags cannot overlap i.e. <p>Text here<p>More</p>here</p>

Tip Write your paragraph tags in pairs <p></p> and then place content within them <p>Content</p>. This will help avoid a missing Closing tag.

work Have a play with <br> and <p></p> tags to arrange the content on your page.


> Next Part Three - Introducing colour (color).

Or jump to: Begin | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8


Top of Page