SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,761
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Proper Meta Syntax??

    What is the proper Meta syntax?

    Is it...

    >

    or

    />


    Code HTML4Strict:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
    <meta name="description"
    	content="Postage Meters save money and time, and aren't as expensive as you might think!">


    Debbie

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,881
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    What is the proper Meta syntax?

    Is it...

    >

    or

    />
    It depends. If you're using HTML, just plain old '>'. If you're using fauXHTML, you need ' />'

  3. #3
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,761
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stevie D View Post
    It depends. If you're using HTML, just plain old '>'. If you're using fauXHTML, you need ' />'
    Here is my Header - which I've never really understood?!

    Code HTML4Strict:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
     
    <head>

    Which coding style should I use?


    Debbie

  4. #4
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    749
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    The DOCTYPE is XHTML, so the element must be closed i.e. />

    If you are in any doubt, run your code through the w3 validator and see if it reports an error.

  5. #5
    SitePoint Member Verscienta's Avatar
    Join Date
    Jul 2011
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You will definitely need to close it with /> if you are using xhtml strict. As Victorinox said, try running your code through the validator, it's the easy way to see if your page will validate or not

  6. #6
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Better to switch out the doctype for an HTML Strict one and get rid of all the extraneous />s. (A lot of people say that every browser worth its salt will handle the HTML 5 doctype, even IE6, and even if you don't use a smidge of actual HTML 5. Me, I'm just not certain about that. Anyone want to ease my doubts?)

  7. #7
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,189
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    The HTML5 doctype will work with IE 6+ but its when you start using the new elements that the problem starts, because the news elements such as <header>, <section>, <footer> etc... don't exist in the DOM structure in IE 6, 7 & 8 for example that won't appear. There are a few pollyfills as they are called to rectify this such as the HTML5Shiv which is the most common, the only other thing you need to grab is the HTML5 reset CSS.

    There is a few developers who have made their own reset CSS but the most common one used was designed by Eric Meyer, when you bring these 2 things together the HTML5 elements work a treat in IE 6+


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
  •