XHTML has always been a jittering word for all HTML learners and I believe the so-called fear must be wiped off. XHTML is not all very much different from HTML. It is just a well versed form of HTML. XHTML is a form of XML that Web browsers can use.
Earlier it was HTML then it made the buzz and now the future seems to be of XML. Knowledge of HTML help helps to learn XHTML and the same way XHTML knowledge will help in learning XML.
Below are some simple rules which should be kept in mind while changing your Web design from HTML to XHTML:
Use All Lowercase Tags: Use lowercase letters to write alt. Writing is not allowed, so better use . Nest Elements Correctly: HTML is a bit lenient but XHTML is not. An example: It is wrong.. This can be seen in this example You that the bold and italic elements are overlapping. The correct way to nest these elements is: This is right..
Using End Tags is a must: Every tag must end with a tag and hence must have an end tag. In the start of a paragraph we use the tag and in the end of the paragraph we must use the tag. Same is the case with li tag and all other tags.
End Empty Elements: Generally, no one end empty elements, but you should end empty elements like tag, and you need an end tag for this one too. You can either use to end or you can use an alternative i.e. This can be used in both HTML and XHTML. The same can be used with other empty tags too, such as( hr) tag.
Use Code for Special Characters It is confusing for XHTML to understand some symbols such as < or & inside the attribute values. Instead of using them, write codes. Try these lists of codes to help you: Common Symbols and Less Common Symbols. Instead of writing: ; you could write: .