Glom Posted April 29, 2006 Share Posted April 29, 2006 Before I make the move to a new server, I am looking to create a new template in XHTML 1.0 Strict. Obviously I want to get it finalised with all the bases covered before I change the whole site over or I'll have the annoying task of having to modify every page one by one down the road.Obviously, it's all those declaration jargons and things which I don't know a lot about.Here's the things I've got:DTD showing XHTML strictXMLNS declaration in the html tagmeta keywordsmeta descriptionmeta content-type with charsetIs there anything I've missed? Link to comment Share on other sites More sharing options...
Little Goat Posted April 29, 2006 Share Posted April 29, 2006 well if you want it to be valid XML too, you need to add an xml declaration at the beginning.LG Link to comment Share on other sites More sharing options...
Glom Posted April 29, 2006 Author Share Posted April 29, 2006 well if you want it to be valid XML too, you need to add an xml declaration at the beginning.LG<{POST_SNAPBACK}> Would that be something like this:<?xml version="1.0" encoding="iso-8859-1" ?> I got this when looking at johneva's site (thanks, john!). It was above the DTD. Is the xml declaration like the DTD in that it is outside the main code?Do I also need a language declaration in the html tag? Link to comment Share on other sites More sharing options...
Little Goat Posted April 29, 2006 Share Posted April 29, 2006 yea that looks good, here is what I use for XHTML documents: <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> LG Link to comment Share on other sites More sharing options...
Glom Posted April 29, 2006 Author Share Posted April 29, 2006 Thanks. Link to comment Share on other sites More sharing options...
Little Goat Posted April 29, 2006 Share Posted April 29, 2006 Thanks.<{POST_SNAPBACK}> No Problem. LG Link to comment Share on other sites More sharing options...
boen_robot Posted April 29, 2006 Share Posted April 29, 2006 I would advice NOT to use the XML prolog yet. When IE6 encounters it, it swithes into Quirks Mode instead of following the Scrict DTD. To avoid most of IE's issues, you shouldn't use the XML prolog. If Quirks Mode (IE) and Strict Mode (FF and Opera) both suit you, then you could use the XML prolog.Just incase you don't understand the idea: Quirks Mode is a mode in which the browser(no matter which browser) decides what to do and doesn't follow the declared specification. It chooses among all avaiable(HTML and XHTML) and select what it thinks the author meant. This of course is most of the times different then what the Strict specification implies. Link to comment Share on other sites More sharing options...
Glom Posted April 30, 2006 Author Share Posted April 30, 2006 I would advice NOT to use the XML prolog yet. When IE6 encounters it, it swithes into Quirks Mode instead of following the Scrict DTD. To avoid most of IE's issues, you shouldn't use the XML prolog. If Quirks Mode (IE) and Strict Mode (FF and Opera) both suit you, then you could use the XML prolog.Just incase you don't understand the idea: Quirks Mode is a mode in which the browser(no matter which browser) decides what to do and doesn't follow the declared specification. It chooses among all avaiable(HTML and XHTML) and select what it thinks the author meant. This of course is most of the times different then what the Strict specification implies.<{POST_SNAPBACK}> Okay, if I remove the XML declaration, does that mean I should remove the XML lang declaration from the HTML tag? Link to comment Share on other sites More sharing options...
boen_robot Posted April 30, 2006 Share Posted April 30, 2006 No. The xml:lang is only the replacement of the lang attribute in XHTML and nothing else. However, for the sake of old browsers compatability, it's advisable to use it with the lang attribute as well. New browsers read only the xml:lang (with or without the XML prolog) and old ones only the lang. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now