#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    2
    Rep Power
    0

    Setting the DOCTYPE


    Setting the DOCTYPE

    HTML 5, when used as plain HTML rather than its XHTML 5 sibling doesn’t need a DOCTYPE. But all browsers do, otherwise they go into Quirksmode, which you don’t want: the collision of HTML 5 and Quirksmode is like matter and anti-matter meeting, and will cause a negative reality inversion that will make your underwear catch fire.

    You’ve been warned, so at the top of your document, you need the line <!DOCTYPE html>.

    Some sites “use” HTML 5, when in actual fact all they’ve done is take their existing code and change the DOCTYPE. That’s fine and dandy if you’ve been using valid, semantic code as HTML 5 is very similar to valid HTML 4.01. Eric Meyer mentions small differences like “not permitting a value attribute on an image submit”, and there are a few differences between the languages, summarised in the document HTML 5 differences from HTML 4.

    However, I don’t want simply to rebadge my existing code, but to use some of the new structural elements now.
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,007
    Rep Power
    9398
    Is there an actual question in there or are you just spamming?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    2
    Rep Power
    0
    is just a small comment
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    129
    Rep Power
    11
    Yeah, this happens because the only reason for the doctypes in the first place was to target standard mode over quirks mode. Without a doctype web browsers default to quirks mode. In HTML5 they decided that all that extra mumbo jumbo really isn't necessary, so if you want to target standards mode then just do the simple

    <!DOCTYPE html> And you are done.
  8. #5
  9. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Aug 2005
    Location
    Bucharest ROMANIA
    Posts
    2,557
    Rep Power
    604
    Originally Posted by mario0000001
    That’s fine and dandy if you’ve been using valid, semantic code as HTML 5 is very similar to valid HTML 4.01.
    In fact with HTML 4.01 strict. But HTML5 allows, also, the XHTML strict semantic code.

    HTML5 is not a new language. Id adds new features, but it preserves almost all the old ones (HTML4 or XHTML).

    Nothing fancy, than.

IMN logo majestic logo spyfu logo threadwatch logo seochat tools logo