SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Evangelist winterheat's Avatar
    Join Date
    Aug 2007
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    to validate as Quirks mode, cannot skip DOCTYPE but then cannot use HTML 3.2 DOCTYPE

    When validating something in Quirks mode, I tried skipping the DOCTYPE all together, but the validator will say

    Unable to Determine Parse Mode!
    and then when I specify a DOCTYPE of HTML 3.2

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    then all the inline style will give error

    there is no attribute "STYLE"
    so it is a bit of a dilemma... we sometimes need to use inline style... but with it, we can never validate as Quirks mode.

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know why you'd want to use quirks mode, but this should do it:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    Provided you've marked up the page according to HTML 4.01 Transitional, of course.

    The style attribute was added in HTML4, so it's not valid in HTML 3.2.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Evangelist winterheat's Avatar
    Join Date
    Aug 2007
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i thought when the browser sees that, it will render the content using Standard Compliance mode?

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not if you omit the formal system identifier (the DTD URI). The following doctype declaration would trigger standards mode in IE and 'almost standards mode' in Opera, Firefox, Safari:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    Without the FSI it will trigger quirks mode in the aforementioned browsers. Your problem, of course, is that quirks mode is quite different between browsers.
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Evangelist winterheat's Avatar
    Join Date
    Aug 2007
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wow that's great info... no wonder sometimes i see the "short version" of DOCTYPE. Thanks!

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,604
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Of course pages set up like that are intended for one browser only since the page will look completely different in each browser since quirks mode basically means whatever the browser authors though the code should mean which is different for each browser. That means that by using quirks mode you are potentially presenting half your potential audience with garbage in order to use the quirks mode format used by the browser the other half are using.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  7. #7
    SitePoint Evangelist winterheat's Avatar
    Join Date
    Aug 2007
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think though, the main thesis of the current post is together with this post http://www.sitepoint.com/forums/show....php?p=3967899, is to simulate standard compliance mode by using 4 div's. The example I have in post #1 above using 4 div's should render all the same on any browser... as long as the browser supports the div element.

    by the way is 1998 or 1999 about the time that the div element got implemented into a real browser for the first time?

  8. #8
    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 winterheat View Post
    by the way is 1998 or 1999 about the time that the div element got implemented into a real browser for the first time?
    The div element type was introduced in HTML 3.2, which became a W3C recommendation on 14 January, 1997. I'm not sure how long it took for browsers to comply with it, though.
    Birnam wood is come to Dunsinane

  9. #9
    SitePoint Evangelist winterheat's Avatar
    Join Date
    Aug 2007
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    to reminisce about it... i remember all of a sudden seeing "span" and "div" in some code on the web and started wondering "what the heck are they"? and then,... 10 years passed, doesn't time really fly...

    by the way, since the "longest time and slowest time" in our life seemed to be the elementary school days, high school days, and university days... will school teacher feel time go by really slowly too since they are in school? or maybe if go back to school to take a master or PhD, then time will become slow once again?


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
  •