SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 26
  1. #1
    SitePoint Member
    Join Date
    Jan 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Page validates xhtml 1.1, but tables are broken by the doctype?

    Hey there,

    I've been pulling my hair to try and figure out this problem.

    I am just going back and validating an old website of mine, and I have gotten it to comply with the XHTML 1.1 standard.... but the tables (which you can easily see) are a little.... odd. The top and bottom bars (as well as an unwanted space in the middle somewhere) creep up when I use the 1.1 and 1.0 Strict doctypes, but work fine with 1.0 Transitional. This issue is present in Firefox and Opera, but not IE. IE has its own issues (which I would kindly ask for help on too).

    The website is http://fb2k.retro-spect.ca/index_xhtml11.html
    Note that its just a test page, and any links back to it will bring you to the original, not this one.

  2. #2
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First, you are using the XML declaration on the first line. Only modern browsers know what to do with it while IE6 will choke and go into quirks mode. Remove that first line.

    Second, you shouldn't be using xhtml1.1 and serving it as html. Drop back to ver 1.0 if you must use xhtml.

  3. #3
    SitePoint Member
    Join Date
    Jan 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    serving it as html?

    I'm not sure what you mean by this, sorry if I've been out of the loop for a while. I intended to create this page as valid xhtml 1.1 code and then slice it up for use with php. I can remove the xml line, but that still doesn't solve my issues with xhtml 1.0 strict.

  4. #4
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What he means is that by serving your XHTML 1.1 file with text/html you are not serving it as an XML application, but faking it as HTML instead. Also, the XML prologue above the DOCTYPE forces Internet Explorer 6 into quirks mode, which means your page will display the same way as IE 5 and 5.5 (broken box model and all). If you're going to use XHTML 1.1 you must serve it as application/xml or application/xhtml+xml - however, this will cause Internet Explorer (all versions) to attempt to save a copy of the file, since it has no idea what to do with it. And with IE having upwards of 85% of the total market share, that's a HUGE problem.

    As for the rest, I'll get back to you once I've cleared out the 30-ish other tabs I have open.

  5. #5
    SitePoint Member
    Join Date
    Jan 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any help from anyone would be appreciated.

  6. #6
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I think the above qualifies as 'help'.

    XHTML 1.1 is pointless to use because internet explorer doesn't support application/xhtml+xml.

    Your options are to use XHTML 1.0 or HTML 4.01 and serve your pages as text/html. If you don't know what is meant by "serving something as" it means you are telling the browser what sort of file it's requesting. If you are using a server side language, you can declare this in the header. E.g. with PHP:
    PHP Code:
    header("Content-Type: text/html"); 
    or simply in the HTML, you use a meta tag:
    HTML Code:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    You could also leave all that stuff out if the file ends in .html, but it's good practice to inform the browser what you're giving it.

  7. #7
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Raffles, you aren't quite correct. This is something the browser (or any other user-agent) must know before it starts parsing the file, hence the meta element is not sufficient.

    Don_Komarechka, why use XHTML 1.x if you are not using CSS to enable you to use clean structural and semantic markup?

    1) I suggest you learn how semantics apply to X/HTML. Semantics is really a very important subject when it comes to X/HTML.

    2) Why should you avoid using tables for layout?
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  8. #8
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kravvitz
    Raffles, you aren't quite correct. This is something the browser (or any other user-agent) must know before it starts parsing the file, hence the meta element is not sufficient.
    That makes sense. I suppose this is fairly useless then:
    HTML Code:
    <meta http-equiv="Content-Type" content="text/html;">

  9. #9
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I remember correctly, for HTML (and XHTML served as HTML) the charset, if specified, is used if the server doesn't include it in the HTTP Response headers and when the file is viewed locally. For XHTML served as XML, the XML declaration is used instead, if the server doesn't send the header.

    If I'm wrong, I hope Tommy will set us straight.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  10. #10
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    That makes sense for the charset, but using that meta tag I put above, specifying the content type, would be pointless I would think.

  11. #11
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, it seems that without the charset it's pretty useless.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  12. #12
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    I wonder why is there an increase of XHTML 1.1 post all of a sudden...
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  13. #13
    SitePoint Wizard trampt's Avatar
    Join Date
    Jan 2003
    Location
    Newport, RI
    Posts
    1,997
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logic_earth View Post
    I wonder why is there an increase of XHTML 1.1 post all of a sudden...
    Everyone thinks they have to do the latest and greatest ... usually without knowing why.

  14. #14
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I'm using XHTML 2.0 + XUL.

  15. #15
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Raffles View Post
    I'm using XHTML 2.0 + XUL.
    Since XHTML 2.0 doesn't exist yet, how are you managing that?

  16. #16
    SitePoint Member
    Join Date
    Jan 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the table issues occurs with XHTML 1.0 Strict too. I just want to know whats wrong. its an old site, I am just bringing it up to par. I'm not going to radically redesign it, I just want it to be standards compliant.

  17. #17
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You don't need XHTML to be standards compliant.

  18. #18
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *sigh* Don_Komarechka, the problem isn't showing up in IE because of the XML declaration, which puts IE6 in quirks mode. The solution can be found here:
    That mysterious gap under images and embedded objects
    Images, Tables, and Mysterious Gaps
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  19. #19
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by drhowarddrfine View Post
    Since XHTML 2.0 doesn't exist yet, how are you managing that?
    I've created my own implementation of it and then I replace everything with javascript to make it XHTML 1.0 compatible.

  20. #20
    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)
    Yeah, in XHTML the <meta /> is not read by the XML Processor it's just there if it ends up being 'text/html' such as a standalone situation.

  21. #21
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Raffles View Post
    I've created my own implementation of it and then I replace everything with javascript to make it XHTML 1.0 compatible.
    JavaScript?! You mean you convert it client-side? What's the point?
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  22. #22
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Ego inflation. Puts me a step ahead of the other geeks still using plain old XHTML 1.1.

  23. #23
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    I'll keep my HTML4 its not broken just yet.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  24. #24
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I'll stop now, I'm kidding. I just use XHTML 1.0 Strict because I like the rigidity.

  25. #25
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Raffles View Post
    I'll stop now, I'm kidding. I just use Viagra because I like the rigidity.


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
  •