August 5, 200818 yr I got somewhere definition regarding the basic difference between html and xhtml that xhtml has the extention of html and some flexibility of xml. Well i am not sure about it may be this could be wrong.So it would be great if some of you would define the basic difference between html and xhtml.
August 5, 200818 yr "Teh Rulez" In XHTML, all tags must be closed (including things like <br> and <hr> and <img> which you might recognise from HTML), and all tags / attributes must be in lower case. That's two obvious differences, anyways.
August 5, 200818 yr Also tags have to be closed in the correct order in XHTML so while in HTML you could do this: <strong><em>text</strong></em> In XHTML it has to be like this: <em><strong>text</strong></em> Notice how the last tag opened is the first tag closed, so your code has to be neatly ordered, if you close tags in the wrong order then you will get errors
August 5, 200818 yr Ah, yes, that reminds me. The elements have to be properly quote "nested" unquote. In a way, this is good, because it makes your markup a lot easier to see, especially when you have a crazy amount of elements. There are also some deprecated elements that you shouldn't use anymore: b, i, u, font, center, are just 5 that spring to mind.
August 10, 200818 yr I found it pretty simple to change over from HTML 4.01 to XHTML 1.0 Transitional and CSS. So as far as the coding goes, there were only a few minor changes. Keep all coding lower case as already suggested, that is all your coding within the <tags>. Remember - First tag in = Last tag out. So, for example.....<strong><b>HELLO WORLD</b></strong> The single line break <br> in HTML then becomes <br /> in XHTML (remember the space after the r and before the "forward slash" in the <br /> tag if you want it to validate correctly at W3C. Also for the Horizontal Rule <hr> in HTML. This should be change the same way as the <br> tag to <hr /> in XHTML. Image tags. These did not need to be closed in HTML 4.01, but as a rule change to XHTML, they will now need to be closed, again with the space at the end as with the Line Break and Horizontal Rule tags. EXAMPLE - <img src="images/background1.jpg" /> for XHTML. The biggest change (which is fairly simple when you get used to the change) is the way that you layout your design. Rather than using the <table> design format in HTML, this is now removed and replaced with the <div> design format using CSS, which is linked or embedded as an external file with certain coding within your <head>Tags</head> Also, the <font> tags are removed and are then coded through your CSS file. There is a little more to learn, but these are pretty much the basics. I would definately recommend the change over from HTML 4.01 to XHTML/CSS. There is a lot more control over the entire design and layout of your website with XHTML and CSS Need any more info, just send me a personal message. Will be happy to help if I can. I wouldn't say that I am an expert be any means, but I do have a little incite into XHTML and CSS. Cheers for now Jay
August 10, 200818 yr The biggest change (which is fairly simple when you get used to the change) is the way that you layout your design. Rather than using the <table> design format in HTML, this is now removed and replaced with the <div> design format using CSS, which is linked or embedded as an external file with certain coding within your <head>Tags</head> [*cough*] Tables aren't *removed* in XHTML, they're still perfectly valid but their use is for tabulated data and not layout
August 10, 200818 yr [*cough*] Tables aren't *removed* in XHTML, they're still perfectly valid but their use is for tabulated data and not layout Ooooop's LMAO Too true. I withdraw that quote HEE HEE. Thanks for the correction bluedreamer and apologies for my mis-quotation. I am always coding for design and layout purposes only and have never used it in this case for "Tabulated Data" and didn't think for those that still use it for such purposes. Again, I share my sincere apologies with you all. Thanks again bluedreamer for correcting me Cheers for "EVER" LOL..........Jay
August 14, 200818 yr There are also some deprecated elements that you shouldn't use anymore: b, i, u, font, center, are just 5 that spring to mind. Na ah, <b> and <i> aren't deprecated tags, you can still validate XHTML 1.0 strict with them! I think their just 'frowned upon!' I think putting text in bold can also be useful for SEO purposes and it can be useful to refer to them in CSS instead of creating span's with an id or class for the smallest bits of text. Also you can even still use <big> and <small> Why anybody would I don't really know!
Create an account or sign in to comment