Anyone here code using XHTML Strict?

Discussion in 'General Software Discussion' started by Jeff, Aug 9, 2002.

  1. Jeff

    Jeff Yarr... I be blind!

    Joined:
    May 6, 2002
    Messages:
    3,191
    Likes Received:
    8
    Trophy Points:
    48
    Just curious? Any of you guys do it?
     
  2. Malus

    Malus BSD SMASH!

    Joined:
    May 13, 2002
    Messages:
    1,170
    Likes Received:
    3
    Trophy Points:
    0
    Yes.
     
  3. Sourcer_2002

    Sourcer_2002 BANNED

    Joined:
    Jul 8, 2002
    Messages:
    2,677
    Likes Received:
    0
    Trophy Points:
    0
    Nope shit im still learning the basics lol :)
     
  4. Malus

    Malus BSD SMASH!

    Joined:
    May 13, 2002
    Messages:
    1,170
    Likes Received:
    3
    Trophy Points:
    0
    XHTML is just stricter coding while using CSS to make the layout.
     
  5. Jeff

    Jeff Yarr... I be blind!

    Joined:
    May 6, 2002
    Messages:
    3,191
    Likes Received:
    8
    Trophy Points:
    48
    Well HTML 4.01 Strict is almost just as strict... It depends which DTD you are going to use ;) But strict is my preference now.
     
  6. radTube

    radTube just keepin' it cool

    Joined:
    May 9, 2002
    Messages:
    228
    Likes Received:
    0
    Trophy Points:
    0
    Currently coding in XHTML Transitional. Should I do Strict? Why? Cyborg, please share your wisdom :)
     
  7. Malus

    Malus BSD SMASH!

    Joined:
    May 13, 2002
    Messages:
    1,170
    Likes Received:
    3
    Trophy Points:
    0
    Cyborg, would you happen to know how to center layers on a page using CSS? There is the text-align attribute, but that doesn't really do what I want it to. I used to use <div align="center"></div>, but you obviously can't use HTML attributes when using XHTML strict.
     
  8. Jeff

    Jeff Yarr... I be blind!

    Joined:
    May 6, 2002
    Messages:
    3,191
    Likes Received:
    8
    Trophy Points:
    48
    Are you trying to center a layer or a table? I know how to do a table, but I am not completely certain when using Layers
     
  9. radTube

    radTube just keepin' it cool

    Joined:
    May 9, 2002
    Messages:
    228
    Likes Received:
    0
    Trophy Points:
    0
    Can't you just set the right and left marigins to "auto"? I actually read that's the preferred way of doing horizontal centering in css.
     
  10. Malus

    Malus BSD SMASH!

    Joined:
    May 13, 2002
    Messages:
    1,170
    Likes Received:
    3
    Trophy Points:
    0
    I wanted to center layers. I tried the auto attribute, but it doesn't work.
     
  11. radTube

    radTube just keepin' it cool

    Joined:
    May 9, 2002
    Messages:
    228
    Likes Received:
    0
    Trophy Points:
    0
    CSS does use absolute values for positioning. You should be able to at least center CSS boxes by setting the left and right marigins to auto. If you're using something else as layers, well... you might need javascript or something to do the centering. And if you're talking about netscape <layers>, well, you shouldn't be :).
     
  12. Jeff

    Jeff Yarr... I be blind!

    Joined:
    May 6, 2002
    Messages:
    3,191
    Likes Received:
    8
    Trophy Points:
    48
    I'll have to give centering a layer a shot.
     
  13. UberLord

    UberLord A Legend in Underwear

    Joined:
    May 8, 2002
    Messages:
    5,255
    Likes Received:
    4
    Trophy Points:
    0
    Centering layers is a bitch, because IE doesn't do it properly

    Correct way using CSS
    <div style="margin-left: auto; margin-right: auto;">
    Centered DIV
    </div>

    F*cked up way to fudge IE - which causes problems with other browsers
    <div style="text-align: center;">
    <div style="margin-left: auto; margin-right: auto; text-align: left;">
    Centered DIV
    </div>
    </div>


    Not 100% sure about this, as I can't be arsed to try it out, but you get the general idea

    EDIT: Updated IE bodge to stop the text from centering
     
  14. UberLord

    UberLord A Legend in Underwear

    Joined:
    May 8, 2002
    Messages:
    5,255
    Likes Received:
    4
    Trophy Points:
    0
    Oh yes.
    And its all validated by http://validator.w3.org/

    Basically I do this so that my stuff is future proofed quite well.
    I also use some JavaScript to fudge some of IE's crappy CSS implementation.
    Shame that I can't do anything about Opera's - but hey ho.
     
  15. Malus

    Malus BSD SMASH!

    Joined:
    May 13, 2002
    Messages:
    1,170
    Likes Received:
    3
    Trophy Points:
    0
    Wow, that trick worked. At first, I thought the auto didn't work since I didn't bother to try it under Mozilla. But with text-align and auto, it actually works under both IE and Mozilla. Thanks guys, that problem had been bugging me for a while.

    Also, programming in XHTML Strict made it so I had to only change a few lines in my external CSS to fix my site. :D
     
  16. Malus

    Malus BSD SMASH!

    Joined:
    May 13, 2002
    Messages:
    1,170
    Likes Received:
    3
    Trophy Points:
    0
  17. Jeff

    Jeff Yarr... I be blind!

    Joined:
    May 6, 2002
    Messages:
    3,191
    Likes Received:
    8
    Trophy Points:
    48
    Yes, all my stuff is validated by W3C as well.
     
  18. Malus

    Malus BSD SMASH!

    Joined:
    May 13, 2002
    Messages:
    1,170
    Likes Received:
    3
    Trophy Points:
    0
    I validate it all as well.
     
  19. UberLord

    UberLord A Legend in Underwear

    Joined:
    May 8, 2002
    Messages:
    5,255
    Likes Received:
    4
    Trophy Points:
    0
    Re:

    I updated my bodge post to stop the centered DIV from centering the text as well :)

    But you probably worked that out already ;)

    I've written a browser/platform detection script in PHP that works very well if anyones interested. I need this, because my code is 100% xHTML/CSS strict. Then, if the code detects a non-compliant browser (even Mozilla 1.0 has a few quirks) then the output is "bodged" depending on the browser/platform

    This ensures that the data sent to the client is as small and reliable as possible.
     
  20. Malus

    Malus BSD SMASH!

    Joined:
    May 13, 2002
    Messages:
    1,170
    Likes Received:
    3
    Trophy Points:
    0
    Re:

    Yeah, I figured that out pretty quickly on my own. :cool:

    I'm interested in seeing the script. I'm not really far into PHP yet, but I've always wanted to examine scripts and learn how they work.
     

Share This Page

visited