Forum Moderators: open

Message Too Old, No Replies

XHTML - Is it all that?

         

monkeythumpa

4:49 pm on Apr 22, 2005 (gmt 0)

10+ Year Member



So would switching my site to XHTML with a strict doctype really eliminate all the cross browser layout hacks?

It seems like a headache at first but a good idea in the long run. About 10 pages control 95% of my site then I have to go through about 50 static pages. It seems like since the browser war has heated up again the benefits are increasing.

tedster

5:45 pm on Apr 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, I'd say xhtml isn't 'all that'. If you need xml, then use an xhtml dtd. If you don't need xml functionality then I see no reason to write xhtml.

What is a big deal is STRICT mark-up, whether html 4 or xhtml. But cross browser hacks will not vanish - in css especially. However, you may begin to design differently as you grasp the underlying logic, and your new designs may be simpler. At least that's what has happened for me.

rjohara

5:51 pm on Apr 22, 2005 (gmt 0)

10+ Year Member



Second what tedster said. By far the most important thing is regularizing how your pages work is to make sure they all validate (both for markup and CSS), not which exact (X)HTML version they follow. That's won't solve all the problems, but it will help, especially in the future.

tedster

6:58 pm on Apr 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There really are several issues that people tend to blur a bit --

1. Valid mark-up
2. Standards mode
3. Strict DTDs
4. XHTML
5. Layouts without tables

My point of view:

1. Valid mark-up is an essential tool that makes everything easier
2. Standards mode: master these details for cross browser comfort
3. Strict DTDs will future-proof your pages
4. XHTML should be used only as needed
5. Layouts without tables if you are a brave pioneer. Browser support
is not quite ready for prime time, and with cross-browser workarounds
development times tend to be a good bit longer.

cuce

11:13 pm on Apr 22, 2005 (gmt 0)

10+ Year Member



"5. Layouts without tables if you are a brave pioneer. Browser support is not quite ready for prime time, and with cross-browser workarounds development times tend to be a good bit longer."

I found that switching to no tables layouts has sped up my development times. Given the learning curve slowed things down for a while, but now that i feel quite comfortable with css I find myself building sites in 1/4 of the time of a tables layout.

tedster

11:36 pm on Apr 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've heard that from other people - that after some inital learning it gets very easy. Do you find that you just stay away from certain ways of handling divs that proved problematic?

encyclo

12:39 am on Apr 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I agree with tedster's sentiment that it is moving to standards-compliance mode rendering (triggered by using a full or strict doctype) which is the key to improving browser handling of your pages. Using an appropriate XHTML 1.0 doctype will trigger this mode, but it offers very few other advantages over HTML 4.01. (OK, you can use an
id
on the
html
element, but that's about all). If you decide to follow the misguided fad of using mime-type switching for XHTML then you are actually putting yourself at a significant disadvantage compared to HTML 4.01.

I prefer HTML 4.01, strict if possible, transitional if required, and validated unless I have a very good reason not to. However XHTML is making significant headway as the default standard in tools such as CMSs. The last three sites I built were all done with XHTML 1.0 as the generated markup (not controlled by templates) was XHTML compliant, not HTML compliant.

ergophobe

2:34 am on Apr 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Personally, I like to stick to one thing - I can't always do that since sometimes I inherit something. A long time ago, for reasons that were really based on not understanding the "why" of XHTML, I chose to default to XHTML 1.0 strict.

At this point, whatever tedster says about which is more appropriate, it's just a whole lot easier for me to do xhtml 1.0. I agree though that what matters is a strict doctype and validating to that.

Do search engines care? They don't seem to. Do visitors care? Of course not. Does it help me figure out why things aren't working and save me lots of time in the long run? Absolutely.

2by4

5:54 am on Apr 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



"Do you find that you just stay away from certain ways of handling divs that proved problematic?"

I find I tend to stay away from methods in general that have proved problematic rather than individual tags, each situation is slightly different, and has a different solution, it's very much like programming, as you improve your old stuff gets less appealing, and your new stuff gets cleaner. I'm always finding new bugs on different browsers, just found one with Konqueror/Safari that blew up a layout.