Here is the code for a basic HTML page:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Basic HTML Document</title>
</head>
<body>
<p>Look at me, I'm coding in html...<p>
<br>
<p>This is my second paragraph!<p>
</body>
</html>
It breaks down like this:
tag:
doctype (this tells the browser at what coding standards you are coding the rest of the page. For more on doctypes see
this link.)
tag:
html (wraps everything except doctype)
tag:
head (this holds more information for the browser; javascripts, css, page titles, etc.)
tag:
title (this is what shows at the very top of the page and helps when indexing your page elsewhere)
tag:
body (this hold the body of your website, it's that simple)
The next few are not part of the required code for a page, but are used in this example to format the content.
tag:
paragraph (this defines your paragraphs)
tag:
linebreak (you can see this between the two paragraphs in the example above... it defines a forced line break between items)
You will notice that all of the tags in the example have an opening tag
Code:
<html>
and a closing tag
Code:
</html>
Most tags DO need to be closed. A few examples of tags that do not are:
Code:
<br> & <hr>
Line break and horizontal rule
This is really basic, but we needed to start somewhere and as we progress make sure everyone is up to speed... So I hope this helps.