Essential Things to Place in HEAD?

  • # January 14, 2013 at 2:55 pm

    Aside from the stylesheet linking, and other linking scripts– what are some ESSENTIAL things to place in the portion of your HTML file?

    # January 14, 2013 at 3:23 pm

    This reply has been reported for inappropriate content.

    Meta keywords, meta description, title & character encoding

    # January 14, 2013 at 3:31 pm

    Disregard the keyword metatag completely. It doesn’t have any effect on search ranking.

    # January 14, 2013 at 5:28 pm

    This reply has been reported for inappropriate content.

    I include the doctype in the head section so the browsers know what version of HTML I’ll be using. Hope that helps.

    # January 14, 2013 at 5:30 pm

    meta charset=’utf-8′

    # January 14, 2013 at 5:43 pm

    HTML5 Shiv/Shim within a conditional comment.

    # January 14, 2013 at 8:37 pm

    This reply has been reported for inappropriate content.

    You could also, as a suggestion, view the source of any site (including this one: view-source:http://css-tricks.com/) to get an idea of what to include in the head section.

    # January 14, 2013 at 9:39 pm

    it’s not essential per se, but i almost always include modernizr. http://modernizr.com/

    it includes both an HTML Shiv (which allows old browsers to recognize html5 tags), and also enables device/browser feature detection by writing conditional css and js. which really helps with progressive enhancement.

    # January 14, 2013 at 10:33 pm

    This reply has been reported for inappropriate content.

    ~~~
    <head><br />
    <meta charset="utf-8"><br />
    <meta name="description" content=""><br />
    <meta name="viewport" content="width=device-width, initial-scale=1"><br />
    <title></title><br />
    <link rel="stylesheet" href="css/main.css"><br />
    <link rel="author" href="humans.txt"><br />
    <!–[if lt IE 9]><br />
    <script src="js/html5shiv.js"></script><br />
    <![endif]–><br />
    </head><br />
    ~~~

    # January 15, 2013 at 1:03 am

    Language attribute on your “html” tag. Discovery “link” to your rss feed (if you have one). meta “viewport.” Unique meta description for every page. rel canonical tag.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed