SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Location
    United Kingdom
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Which meta tags are actually worth using?

    I was intrigued by the huge quantity of possibly unnecessary meta tags that I saw in the source of a website recently. Can't recall the site or exactly what all the tags were, but some of them related to update frequency (isn't that already covered by an XML sitemap?), location, author, etc. I have only ever used the following:

    Code:
    <title></title>
    <meta name="description" content="" />
    <meta name="language" content="EN" />
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    But are there any others that would be worth including? A web search didn't bring any definitive and up to date list of tags, what they do, and whether they are useful or necessary.

  2. #2
    SitePoint Zealot
    Join Date
    Sep 2008
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The title tag is the most important, then the description.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Location
    United Kingdom
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I know that. I was asking about the tags that I don't currently use.

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    There is really no need for any meta elements, you can strip them all away and save a few bytes. Btw, title element is not a meta element. Very little are even used, Content-Type might be used in some cases when saved locally but that can be contained in a real HTTP header.

    Unless you are using something other then CSS I don't see the point of specifying "Content-Style-Type" in a meta element. That should be in an HTTP header. Also it is for the style attribute.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Location
    United Kingdom
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unless you are using something other then CSS I don't see the point of specifying "Content-Style-Type" in a meta element. That should be in an HTTP header. Also it is for the style attribute.
    I have been using it exactly as Sitepoint's very own books demonstrated, so I'm not at all sure what you mean. And I don't agree with your suggestion of stripping them all away: I started using the description because Google was not making the best choice for its description of the site that I manage. It now uses the description text as provided.

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logic_earth View Post
    Unless you are using something other then CSS I don't see the point of specifying "Content-Style-Type" in a meta element. That should be in an HTTP header. Also it is for the style attribute.
    Technically, that HTTP header (or a meta equivalent) is required if you use style attributes (which is generally not a brilliant idea).

    Similarly, you're supposed to use a Content-Script-Type header (or meta equivalent) if you use event attributes like onclick.

    In real life, I think all browsers assume CSS and JavaScript, respectively. But, of course, the best course of action is to keep all CSS and scripting external.
    Birnam wood is come to Dunsinane

  7. #7
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It all depends on what you are using them for.

    I use the following because the "Cynthia" automatic Web Content Accessibility checker requires the information for a "pass" report in order to comply with WCAG 1.0 Checklist, checkpoint 13.2, Priority 2 requirements. That is not really a good reason, but I do it anyway. Meta Key words especially used to be given a lot of weight in SEO rankings, but I believe that these days quality of content is the main determinant (but that is another story):

    <meta name="language" content="en-US" />
    <meta name="description" content="appropriate information" />
    <meta name="keywords" content="one, two, three" />

    I use Dublin Core (DC) Metadata in conjunction with RDFa in XHTML to extract, transform and manipulate data from my Web pages, therefor I include the following meta information (examples -- link rel included to illustrate the schema origin):

    <link rel="schema.DC" href="http://purl.org/DC/elements/1.1" />
    <meta name="DC.Contributor" content="name" />
    <meta name="DC.Coverage" content="major category" />
    <meta name="DC.Creator" content="name" />
    <meta name="DC.Date" content="last update: YYYY-01-01" />
    <meta name="DC.Description" content="appropriate information" />
    <meta name="DC.Format" content="size: approx. 00.00kb" />
    <meta name="DC.Identifier" content="XHTML 1.0 (strict) Markup" />
    <meta name="DC.Language" content="en-us" />
    <meta name="DC.Publisher" content="name" />
    <meta name="DC.Relation" content="allied with" />
    <meta name="DC.Rights" content="Copyright or license information" />
    <meta name="DC.Source" content="documents, references, etc." />
    <meta name="DC.Subject" content="material covered" />
    <meta name="DC.Title" content="Page title" />
    <meta name="DC.Type" content="Web Document" />

    James

  8. #8
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    @AutisticCuckoo, the thing I just cannot figure out, what other language or data can go into style attributes? And if there is what is the support from current browsers?

    After reviewing the specs on Content-Style-Type, if omitted it defaults to text/css which reinforces what I said "Unless you are using something other then CSS..."
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  9. #9
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logic_earth View Post
    @AutisticCuckoo, the thing I just cannot figure out, what other language or data can go into style attributes? And if there is what is the support from current browsers?
    There is no alternative these days. Once upon a long time ago Netscape tried to introduce a style language with a JavaScript-like syntax. I guess it was supported by some early Netscape Navigator version, but it never caught on.
    Birnam wood is come to Dunsinane

  10. #10
    SitePoint Evangelist happyoink's Avatar
    Join Date
    Jan 2008
    Location
    UK
    Posts
    503
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So are you saying that I should leave that out other than specifying where my CSS or JS file can be found?

  11. #11
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you use only external CSS and JS, those headers can be left out. If you use style attributes or event attributes, you should keep them (even if they probably won't be used).
    Birnam wood is come to Dunsinane

  12. #12
    SitePoint Evangelist happyoink's Avatar
    Join Date
    Jan 2008
    Location
    UK
    Posts
    503
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well obviously I write my CSS in a separate .css file. I try to avoid putting CSS in the same file as the HTML is written in.

    The JS - sometimes that's in the same file as the HTML, usually in the <head> or right before the </body> tag.

    Otherwise, it's in a separate .js file.

  13. #13
    SitePoint Zealot livetech's Avatar
    Join Date
    Oct 2008
    Location
    Colwyn Bay, North Wales, UK
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    There is no alternative these days. Once upon a long time ago Netscape tried to introduce a style language with a JavaScript-like syntax. I guess it was supported by some early Netscape Navigator version, but it never caught on.
    Off Topic:

    I believe it was in Netscape 4, and it was called Layers.

  14. #14
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Silver Firefly View Post
    Well obviously I write my CSS in a separate .css file. I try to avoid putting CSS in the same file as the HTML is written in.
    That's good practice, but not everyone follows it. Some point-and-click design tools can also litter the markup with style attributes if you don't know how to handle them properly.

    Quote Originally Posted by Silver Firefly View Post
    The JS - sometimes that's in the same file as the HTML, usually in the <head> or right before the </body> tag.

    Otherwise, it's in a separate .js file.
    Any <script> tags don't matter (you need to use the required type attribute for those to specify the script language).

    The Content-Script-Type HTTP header is only required if you use script attributes in your markup, like onclick="myHandler()".
    Birnam wood is come to Dunsinane

  15. #15
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    In real life, I think all browsers assume CSS and JavaScript, respectively.
    In HTML5, <script> automatically assumes javascript and the 'type="text/javascript'" is not required.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •