Your Second Web Page
Now that you have created your first webpage, let us examine the different
segments of your "index.html" file. You have probably noticed a pattern of various words that are surrounded with <
and >. These items are called HTML tags.
An example of an html tag is <body>. The Body tag tells the browser where the page's content begins.
Body is also an example of one of the required HTML tags that every web page must have.
Basic HTML Tag Information
Let's learn more about these tags. A basic web page is composed of 2 main tags. If you create a web page without these
tags you will be in trouble!
Your site's content goes here
The first HTML tag, which conviently is labled <html> tells the browser that
your HTML code is starting. The second HTML tag, <body> tells the browser that the visible part of the
webpage ( your content ) is going to start.
Closing Tags - </tag>
You might be wondering what is the deal with the two tags at the end, </body>
and </html>. These tags are telling the browser that certain tags are ending. The </body> lets the browser know that your content
is ending, while the </html> tells the browser that your HTML file is finished.
The "/" that is placed before the tag's name
informs the browser that you would like to stop using the specified tag.
<tag> is used to begin a tag and </tag> is used to end a tag.
HTML Tag Order - Important!
The order that opening tags appear and ending tags appear follow an important rule.
If an HTML tag is opened within another, for example the body tag is opened inside the html tag,
then that tag(body) must close before the outter(html) tag is closed.
We ended the body tag first because it was opened most recently. This rule of "closing
the most recent tag before closing older tags" applies to all HTML tags.
These ideas might take a while to sink in, so how about you create your second web page?
Copy this code into notepad, like you did before, following the same directions.
<title>My Own Webpage!</title>
<h2>Welcome to my webpage</h2>
<p>Coming soon will be my completed webpage that will wow and impress you!</p>
After you are sure that your HTML code inside notepad is exactly the same as our provided HTML code, go ahead and
save your file. You should be saving this file as "index.html". You may be prompted that you will be saving over a file,
that is OK, you do not need your 1st web page anymore. When you are done, please continue.
Found Something Wrong in this Lesson?
Report a Bug or Comment on This Lesson - Your input is what keeps Tizag improving with time!