Basic HTML template
Posted Oct 23rd, 2008 by David Calhoun in htmlThis is basically for my own use, but others might find it useful as well:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> <meta name="keywords" content="" lang="en-us" /> <meta name="title" content="" lang="en-us" /> <meta name="description" content="" lang="en-us" /> <meta name="robots" content="all" /> <meta name="author" content="" /> <meta http-equiv="Content-Language" content="en-us" /> <link rel="stylesheet" type="text/css" charset="UTF-8" href="" /> <script type="text/javascript" charset="UTF-8" src="" /> </head> <body lang="en-us"> </body> </html>
And some rationale for ordering of elements:
- Content-Type should be included before everything else in HEAD because this allows the browser to correctly interpret the following tags in the right encoding set
- Title should be included right after the content-type tag, since it’s probably the most important part of the entire page. It allows the user to determine if they want to look at the rest of the page.
- CSS is usually more important than JavaScript, so it’s included first. The user usually starts looking at the content first, which is styled by the CSS. Usually JavaScript only takes in effect when the user interacts with the page. But the user usually interacts with the page only after viewing content, so the content (HTML) and styling of that content (CSS) take precedence.
Leave a Reply
Categories
- accessibility (1)
- browser bugs (2)
- css (6)
- html (6)
- javascript (9)
- jquery (3)
- mobile (1)
- performance (2)
- php (1)
- regular expressions (1)
- rss (3)
- seo (1)
- Site News (1)
- table (1)
- Uncategorized (4)
- videos (2)
- wordpress (1)
- xml (2)
- yui (0)
[...] last entry I made as some really nicely formatted code, if I do say so myself. It’s because I’ve [...]