SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2012
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Difference between caps and no caps in meta data

    Can you please tell me the difference between:


    <meta Name"keywords" content="Magento, Varien, E-commerce" />

    <meta NAME" . . . />

    <meta DESCRIPTION "..../>description

    meta description "..../>

    I see them both ways when viewing source of sites.

    Thank you.

  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    In valid XHTML you don't see the mixed case or uppercase (she accepts case sensitive lowercase for those attributes). XHTML documents must use lower case for all HTML element and attribute names. This difference is necessary because XML is case-sensitive e.g. <li> and <LI> are different tags.

    It also depends on the markup language, and rule of thumb is; always use lowercase for the META and its attributes; <meta name="keywords" content="..." /> would be the correct format. The value of the content, i.e. keyword list is also case-sensitive but can be mixed.

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,611
    Mentioned
    413 Post(s)
    Tagged
    7 Thread(s)
    One thing they all have in common is that they are wrong.

    Rather than

    Code:
    Name"keywords"
    NAME"
    DESCRIPTION "
    and so on, it should be

    Code:
    name="keywords"
    name="description"
    and so on.

    Tip: always use lower case, no matter what—in code, file names etc. It's neater and saves potential problems that you don't need to be worrying about.

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2012
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you. I've seen the caps used often - it seems especially so on what I think of as "newer professional sites". I thought it was a more current way of doing it for HTML5 or CSS5!

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,611
    Mentioned
    413 Post(s)
    Tagged
    7 Thread(s)
    Whenever I see capitals in code like that, I instantly think "amateur". Probably unfair, but still, lower case is a good rule to follow.

  6. #6
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Crumbles View Post
    Thank you. I've seen the caps used often - it seems especially so on what I think of as "newer professional sites". I thought it was a more current way of doing it for HTML5 or CSS5!
    When you see caps, it's often likely the result of a site's code having been generated automatically with some obsolete IDE or website builder.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  7. #7
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    I think you meant CSS 3, as CSS 5 is even a twinkle in Paul's eye. Usually it shows poor craftsmanship or pollution from an editor either liveware or software like both Ralph and Maleika mentioned if you get such 'inconstancy'. Since those examples suggest attempted XHTML grammar they ought to be lower case. Even most HTML5 material recommends using lowercase. In the age of dinosaurs sometimes authors wrote uppercase for tags and lowercase for attributes but it was a pointless exercise.

    Well, modern looking outwardly can drastically differ from the syntax under the hood so don't always be fooled by visually stunning fašades and the painted eyelids as they may be covering deeper cracks.


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
  •