The basic website structure

<!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” xml:lang=”en” lang=”en”>
<head>
<meta http-equiv=”content-type” content=”text/html; charset=utf-8″ />
<meta name=”description” content=”Enter your description here.” />
<meta name=”keywords” content=”keywords, are, always, good, to have” />
<meta name=”author” content=”Site Author” />
<link rel=”stylesheet” type=”text/css” href=”style.css” media=”screen” />
<title>Welcome to my site!</title>
</head>
<body>
Content here.
</body>
</html>

Confused? Here’s the explanation:

Starting at the top, we have your Doctype. This is an important piece of information because it is needed by browsers or other tools processing the document. In other words, your markup and css won’t validate without it. This example is specified for xhtml 1.0 strict. {Need more information? Here is a great article. }

In the <head> section, you can see the <meta> tags. These are used in search engine optimization. Then, we come to the link to the external stylesheet.

<link rel=”stylesheet” type=”text/css” href=”style.css” media=”screen” />

This allows you to use one stylesheet for all of your pages, which means that you won’t have to go through the tedious task of fixing all your pages if you happen to find an error.

Note: Remember not to include <style type=”text/css”> , </style> tags, otherwise, you’ll run into some nasty issues.

Asides

Affilates

Advertising

Recent Comments