Click to See Complete Forum and Search --> : What /needs/ to be in <head>


freak
03-21-2004, 05:48 PM
I would like to know what needs to be the <head> of a document and/or what you recommend to have in the <head> of a document.

That's pretty much it.

// freak

ray326
03-21-2004, 07:14 PM
Title, stylesheet and Javascript functions are the main ones.

IncaWarrior
03-21-2004, 07:17 PM
content type

spufi
03-21-2004, 09:01 PM
Here's a somewhat list based on a current template I'm working on.

<title>tag.
<meta> tag showing description.
<meta> tag showing who is the author.
<meta> tag showing the copyright.
<meta> tag showing the language.
<meta> tag for robots.
<meta> tag for revisits.
<meta> tag for showing rating of content like "general."
<meta> tag for content-type.
<link> tag for external stylesheet.
<javascript> tag for any JavaScript.
<link> tag for favicon.

Now, most people would also incluce a <meta> tag for keywords, but very few search engines use that tag anymore, so I would debate how usefull it is.

toicontien
03-21-2004, 10:44 PM
On the note of content types, here are a few to get you started:

<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1" />

<meta http-equiv="Content-Type"
content="text/html; charset=utf-8" />

<meta http-equiv="Content-Type"
content="text/html; charset=utf-16" />


Note that your should save your HTML files in Unicode if you want the UTF-16 charset to actually work. And then you'll need all your JavaScript and CSS files saved as Unicode too. I think I saw a topic on this site or tutorialforums.com where somebody had saved a Unicode HTML page that imported an ANSI charset CSS file, and the browser didn't recognize the CSS file.

Robert Wellock
03-22-2004, 10:44 AM
I recommend that the <title> element go within the head and depending upon which language you use character encoding is also another good choice.

Again, default Content-Script-Type and Content-Style-Type are also good contenders.