(be aware that doing so will force Internet Explorer into Quirks Mode. Don't know what that means? Go to Google. There are thousands of articles detailing the whys and wherefores. My advice? Skip it. It's not necessary.)
2. Use a proper, valid DOCTYPE:
XHTML 1.0 Strict, Transitional, Frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
XHTML 1.1 DTD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3. a) (If you use XHTML 1.0) Change your <html> tag to read:
Of course, this is only the beginning. By taking this first step you are opening yourself up to the wonderful world of designing with web standards, and can start to truly appreciate the amazing bandwidth savings you can achieve.
(Having said that it is perfectly possible to have a completely valid XHTML document that uses nested tables, spacer gifs and all the outdated junk markup HTML is littered with. But what would be the point of that, right?)
ps...To any XHTML purists out there, I know that if you use XHTML you should serve your document as application/xhtml+xml, but until there is a reliable way of doing this that doesn't give Internet Explorer the willies, I'll stick to the old-fashioned text/html. I know of one resource that may be of use, but haven't tried it. The url to the article is: http://keystonewebsites.com/articles/mime_type.php. If someone's tried it and fancies sharing their knowledge, please do!
Originally posted by Zopester If someone's tried it and fancies sharing their knowledge, please do!
I am the author of the article, and the method is used by many sites (mostly blogs). If anyone has any specific questions about how it works, please use the contact form on the Keystone Websites contact page.
XHTML is to get one out of the bad habits we learned with HTML.
Gets us ready to code properly for when we move to XML as well. Which is why I found it strange to use the DTD mentioned in #1 for XHTML -- that DTD is for XML whereas this thread is supposed to be about XHTML.
I been using the 'application/xhtml+xml' directive for awhile now, but only with our index page. This is to prove to our Clients that want to use it, it is available. XHTML was fairly easy to get used to and much easier than learning to code using CSS for positioning, as opposed to Tables. Using Tables to position Content is one of those bad habits I mentioned.
Although I recommend everyone to switch to XHTML, starting with Transitional and staying with it for awhile will make using XML that much easier. IE is slowing up the change to XML though so you'll have lots of time to get good at both, XHTML Transitional & Strict.
Last edited by Website Rob; 02-10-2004 at 02:38 AM.
• PotentProducts.com - for all your Hosting needs
• Helping people Host, Create and Maintain their Web Site
• ServerAdmin Services also available
Originally posted by webwhiz Just wondering...can older browser read XML? If you use XML do you have to use XSLT? I suppose XML won't go together with CSS?? I'm not a real pro in XML...just beginning to learn about it.
XML is a data format.
XSLT is simply another subset of XML.
Usually XSLT is used to take a pure data XML file and take a presentation layer of XSL and produce a final file combining the data and presentation together.
XHTML is a subset of XML for HTML presentation but following XML rules.
In XML all tags must be closed, this is why we have <br /> instead of <br> in XHTML. You can use <br/> without the space before the / and it will work in most browsers. However so that older browser can understand it we put the space in before the / (as web browsers have always been great at ignoring tags and attributes that they don't understand).
XHTML and CSS are designed to work together. CSS in XML doesn't mean anything unless you clarify what subset of XML you mean. The only one it make sense in is XHTML.
In reality to see one web page there could be as many as 4 XML documents powering a single page
1) An XML file returned from a database
2) XML file gets converted to a website specific XML format
3) XSL file contains the presentation layer to display the XML data file
4) XSL and XML files processed to generate an XHTML file
It can get even more confusing if you start throwing SOAP and Web Services into the equation!