Published On: August 4, 2008
To better understand some of the elements in a typical HEAD section, let’s take a look at a one from another standards-compliant website:
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″/>
<meta name=”description” content=”A 263-unit residential…” />
<meta name=”keywords” content=”creekstone…” />
<title>Home : Creekstone : Franklin, Tenn.</title>
<link rel=”shortcut icon” href=”images/favicon.ico” />
<style type=”text/css” media=”screen”>
<!–[if lt IE 7.]>
Obviously, you have your opening HEAD tag. What follows, the META tags, each have differening purposes. HTTP-EQUIV tags are more or less a simple HTTP header that tells your browser how to handle specific data requests. Stick with the one you see above and you’ll be good for 98% of the sites made. DESCRIPTION and KEYWORDS are exactly that. The first should be a short, but quality, description of what the site is about. The second, a list of keywords that you would want someone to type in a search engine to find your site. While 5 years ago, these were all the SEO hype, they’re not as important these days. However, one never knows if/when search engines will startusing these again… better safe than sorry.
After your META tags, you’ll see a TITLE tag. This is the title for the webpage. You’ll see this in the titlebar of your browser and search engines will display this whenever the site is listed in the search results. The title is a tag that must be carefully created as a cleverly created title can boost the sites findability or SEO. On the other hand, you don’t want a title that is 250 characters long. Make it clear, make it intentional. Following that, give a nice little LINK REL referring to the site’s favicon (if there is one).
Before closing the HEAD out, we’ll throw in any conditional comments that give scpecial instructions to a specific browser or group of browsers. In this case, I’ve thrown in a fix for IE6 to render transparent PNGs correctly. Although incredibly helpful, conditional comments can be a bad thing if used carelessly and in abundance. True purists wouldn’t use these as they’re considered hacks.
Until next time…