SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Apr 2006
    Location
    Long Island, NY
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML Utopia: Designing Without Tables Using CSS

    I downloaded the free chapters of the book 'HTML Utopia: Designing Without Tables Using CSS' from SitePoint. I start to follow along as a new css person. I'm pulling my hair out for 2 days wondering why my css isn't working. It turns out that the <DOCTYPE> info they were using wasn't working for me. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd".>
    <html xmlns="http://w3.org/1999/xhtml">.
    I used <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> and all of a sudden the web page comes to life.
    Is there something I should be doing to get the 'strict' doctype to work? Is it a browser issue? I would think not since I was using Firefox (Mac and PC) Safari, and IE 6 for Windoze.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,227
    Mentioned
    194 Post(s)
    Tagged
    2 Thread(s)

    quirks mode

    I can't keep up with all the browsers and how they support the doctype tag.
    Differences involve
    If the doctype tag is preceded by an xml tag
    If the doctype includes a URL
    For example using
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    which doesn't have a URL will cause some browsers to use "quirks" mode. Wheresas using
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd".>
    which does have a URL would cause some browsers that don't require the preceding XML tag to use "standards" mode. Then again is the page being served as "text/html" or "application/xhtml-xml"
    No doubt that when the book was written browsers handled things differently than they do now.

  3. #3
    SitePoint Member
    Join Date
    Apr 2006
    Location
    Long Island, NY
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK. Well the book was just published in April of 2006...so is that an excuse? Maybe...maybe not. And would I buy a book that, from the exerpts, looks like it has errors?
    My page is being served as "text/html". Anyway unless I find some other way, or someone tells me something different I will be using "Transitional".

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,227
    Mentioned
    194 Post(s)
    Tagged
    2 Thread(s)

    HTML transitional

    There is a way to test for browser support of XHTML and then serve the page as either XHTML or HTML. I am thinking of eventually going to HTML Strict, but my pages are HTML Transitional now and I have no problem with them being that.

  5. #5
    SitePoint Member
    Join Date
    Apr 2006
    Location
    Long Island, NY
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you know where/how I can test for that?

  6. #6

  7. #7
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The issue is about quirks mode vs standards mode. When developing new pages you should always use a doctype that triggers standards mode, IMHO.
    Simon Pieters

  8. #8
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, smackthemouse.com is a great resource, some good related info has been added to the home page

  9. #9
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was going to post zcorpan's link to Henri's site. That's the best info and everyone should follow it.


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
  •