Forum Moderators: open
My websites validate as XHTML 1.0 Transitional. The only thing that prevents them from validating as XHTML 1.0 Strict is the name attribute in <img> for image rollovers. I use both id and name in <img>. Is it advisable to remove name in respect to backward compatibility? Is it worth going to XHTML 1.1?
Also, where can I find codes for other languages, i.e. what else are there besides 'en'?
Thanks.
I'll tackle the language question for you. Because you asked in the context of a DTD dicussion, I assume you are pointing to the "en" in the declaration itself. No matter what language is used for the content of a web page, currently all the DTD's are "en".
If you want to declare a different language for the content itself (as opposed to the DTD) that can be handled with the lang attribute in the <html> tag - i.e <html lang="de">
The W3C has a full listg of the 2 and 3 letter langauge codes:
[w3.org...]
[webmasterworld.com...]
Especially note the question of what mime type to be serving and IE challenges there.
Is it advisable to remove name in respect to backward compatibility?
My rule of thimb is that you should never sacrifice functionality for validity. If you require the
name attribute, then you should use a transitional doctype. I think you're actually talking about forward compatibility: I wouldn't be too concerned - legacy HTML atributes aren't going anywhere soon, and in fact it is unlikely that they will be removed from future browsers for the forseeable future. In the worst case scenario the image rollovers would cease working in 20 years time, which wouldn't be a calamity. In terms of backwards compatibility, name[code] is better supported than [code]id. Is it worth going to XHTML 1.1?
No, it's not a good idea. XHTML 1.1 is not a newer version of 1.0, despite the name: it is a subset of XHTML for use as a module to be combined with other markup languages. It is a mistake to use it as an XHTML 1.0 replacement. I would also recommend not using mime-type switching as detailed in the above thread suggested by tedster, but that's another debate. ;)