All web pages have 2 sections--a head and a body--and follow the same basic format:
<html>
<head> </head>
<body> </body>
</html>
First, notice that there are words in brackets. These are called tags and they give the browser instructions. For example, the first tag, <html>, tells the browser that what is to follow is HTML (the language that represents a web page). The next tag, <head>, tells the browser that the head portion of the page is about to begin. The head includes information about the web page like the title.* The </head> tag tells the browser that the head portion of the web page is done. This is a recurring idea in HTML. Almost every start tag has an end tag. You can identify a start tag because it doesn't have a slash, /, at the beginning while end tags do.
After the <head> tag comes the <body> tag. This tag goes before all the content of a page like text, colors, pictures, and all the stuff that makes a web page. The </body> tag is the end tag for the <body> tag and tells the browser that the content is done. Finally, the end tag </html> on the last line tells the browser that we're done writing our HTML.
Another fact we want to point out is that the browser only recognizes single spaces. This means that I can type all of my HTML code on just one line or spread it out over 50 lines without the browser displaying the file any differently. It's helpful to use tabs and multiple spaces as well as put tags on different lines so that it's easier for us to understand and edit the HTML code.
Yay! Now you know the basic format of a web page and now we can actually put stuff in it!
*FYI: You may have noticed that the code in the HTML Playground doesn't include the <head> tag. This is because the <body> section is the most important part and we wanted to concentrate on that.
|