Basic HTML: Structure Tags
go to: Structure | Text | Tables | Links | Images |
This is a basic web page - notice the pairs of tags marking the structural areas:
Copy and Paste this handy skeleton into the text editor of your choice when hand coding your pages:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My Web Page Title</title>
</head>
<body>
</body>
</html>
DOCTYPE
The document type declaration is not strictly speaking part of the HTML language. However it must begin every web page in order for the rendering (the process that interprets and displays your code) to work properly. It tells the browsers and validators what level your code is and what standards you are applying. The one above is good for the purpose of this class.
HTML tag <html>...</html>
This tag must surround the entire web page (after the DOCTYPE). It must have a head and body within it. The attribute (xmlns) and value above is adequate for this class.
for more info about the html namespace and XML namespaces
Head Section <head>... </head>
The head section has the header information, that information that is not part of the webpage itself, but may list its resources such as css files and scripts. It also includes the title.
Meta tag (within head)
This is optional - there may be none or there may be more than one. Search engines sometimes use the description meta data to search on, but since Google no longer does this it is not as useful as it once was. If you choose to use it this way, these are typical ways to use the name and content attributes to describe your page:
<meta name="keywords" content="html tutorial, teaching html">
<meta name="description" content="tutorial on the structure tags
in html">
Title (within head) <title>... </title>
The title is the name that appears in the very top of the browser and is usually followed by some words identifying the browser itself. The title is also the way most search routines refer to the page so it is very important that this line succinctly describe the purpose of the page.
body <body>...</body>
This is the webpage itself - this is what everyone sees - and contains all the rest of the tags that you think of as being part of the content of the page. The body tag does have attributes but most of these are deprecated in favor of using css to define such things as background color or image, link colors, text fonts and colors.
go to: Structure | Text | Tables | Links | Images |
