Here is a basic HTML page:
<html>
<head>
<title>Title</title>
<head>
<body>
<p>Some text. Hi.<p>
</body>
</html>
Alright, time to dissect it.
<html> – This tag opens the HTML page. All HTML pages start with <html>. The tag that closes this is </html>.
<head> – This tag opens the header of the HTML page. The header doesn’t appear to the user so tracking scripts for statistics and commonly placed. This tag is closed by </head>. Within this tag is also <title>.
<title> – This tag defines the title of an HTML page. It appears at the top of each window in most modern browsers. This tag is closed by </title>. Inside this tag should be plain text.
<body> – This tag defines the body of an HTML page. The body appears in the window of most modern browsers as the “content” of the page. Inside the body can be anything from scripts to images. This tag is closed by the </body>.
<p> – This tag defines a paragraph. When entering text it is not required. If the <p> wasn’t there and the text was right after <body> it would still show the text. Most people who write HTML still use <p> because it can be used to style text in CSS.
To type your own HTML page follow these directions:
On Windows open Notepad or another text editor. Create a new document. Enter the contents of the HTML page and save it. Now you have a text document with the HTML contents. It isn’t an HTML file. To change it to an HTML file simply rename it and switch the extension from txt to html.
On Mac open a text editor. This doesn’t work in TextEdit. I recommend TextMate. Create a new document. Enter of the contents of the HTML page and save it. If you’re using TextMate go to the bottom of the window and change the code mode to “HTML”. This will do some cool stuff with your code and make it look colorful. It’ll also automatically save your file as a html file. If you are using a different text editor that saves to txt (NOT rtf) then rename it from filename.txt to filename.html and it should load correctly in your browser. If you have any questions comment here!









