Discussion in 'General Software Discussion' started by Jeff, Aug 9, 2002.
Just curious? Any of you guys do it?
Nope shit im still learning the basics lol
XHTML is just stricter coding while using CSS to make the layout.
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.
Currently coding in XHTML Transitional. Should I do Strict? Why? Cyborg, please share your wisdom
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.
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
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.
I wanted to center layers. I tried the auto attribute, but it doesn't work.
I'll have to give centering a layer a shot.
Centering layers is a bitch, because IE doesn't do it properly
Correct way using CSS
<div style="margin-left: auto; margin-right: auto;">
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;">
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
And its all validated by http://validator.w3.org/
Basically I do this so that my stuff is future proofed quite well.
Shame that I can't do anything about Opera's - but hey ho.
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.
Here's is the centered site in all of it's glory (well, if the link works):
Yes, all my stuff is validated by W3C as well.
I validate it all as well.
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.
Yeah, I figured that out pretty quickly on my own.
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.
Separate names with a comma.