I usually use XHTML Transitional but I am looking into switching over to XHTML Strict. First question: what are the benefits of using strict? I was looking at a list comparing the two: http://www.zvon.org/xxl/xhtmlReference/Output/comparison.html where it says I am a little confused here. I always use a <br /> to clear floats. Is that not correct? What am I supposed to do instead? I don't use the clear inline. I always define a class called .clear { clear:both; } and then clear by writing <br class="clear" /> Is this also improper use of clear or is it just <br class="clear" /> that is not allowed?
I've never had any problems with validation using <br class="clear" /> in strict. There might be some issues using them within certain elements though (as strict gets mad about ugly semantics in certain block tags like <form>). But: http://validator.w3.org/check?uri=http%3A%2F%2Fbinaerpilot.no%2F; ^ uses br clears and validates.
If the validator called "clear" an attribute, it's a good bet you missed a quote or something. When posting a question like this, be sure to quote the actual error message you got, and if possible, a link to the page, or at least the surrounding markup. cheers, gary
XHTML Strict is "cleaner" code. A number of tags aren't allows and limited properties on the ones that are allowed. The advantage is, the code works in all browsers without any conflicts (although in FF there is an issue with images getting a 1px border that doesn't happen in Trans.) Using strict is mostly for providing super clean code to programmers who put it in different CMS software.
I don't think that there is hardly any difference between transitional and strict I'm pretty sure that the "target" attribute for links isn't part of strict
I stay with transitional unless it's something like an FAQ page where the content likely isn't going to ever include user input. Strict is extremely tough to work with outside of a really basic context. I tried sticking with strict for months before finally just going with transitional instead.
Really. Interesting. Thanks. Good to know. OT: Found your site and listening to your music right now. Cool. And I think your distribution method (TPB) really is the way to go.
Again, thanks. Just proves one shouldn't believe everything you read on the the internet. Anyone who can tell any practical reasons for using strict instead of transitional XHTML? I know it is "cooler" but why is it "better"?
Anything where content will be edited by more than one person. For instance, blog or forum posts. While in a perfect world, everyone would be able to code by hand and know how make everything work in strict, that's just not how it works. It's easier and more efficient to accomidate everyone with a transitional DOCTYPE than it is to teach everyone to use strict guidelines. I spent a couple of years preaching strict DOCTYPEs untill I actually tried to get them to work with sites I wasn't the sole contributer on. Anything where services from a 3rd party website might be used. I had a big problem on website where the site owner insisted on using the output from a 3rd party site to display the status of his game server. The template was originally designed to use strict but ultimately had to be switched to transitional to support <iframe>s. It was either that or bog his server down with PHP requests and cacheing. There's also things like Paypal button forms. For instance the last site I made would validate as strict if I wrapped the <form>s childeren in a container. That means I would have to add an extra element just so the page would validate as strict, when it validates perfectly fine without the container as transitional.
I suggest you depend on the original (w3.org) source rather than derivative references. See annotated xhtml1.0 DTD, in particular, this bit: <!ELEMENT br EMPTY> <!-- forced line break --> <!ATTLIST br %coreattrs; clear (left|all|right|none) "none" > Code (markup): Such a blatant error makes zvon.org's credibility suspect. cheers, gary