Home > Articles > Web Development > HTML/CSS

  • Print
  • + Share This
Like this article? We recommend

Like this article? We recommend

What's New?

Now for the good news. It turns out that XHTML is very similar to "pure" HTML and, if you've followed the HTML 4.0 guidelines, you will probably have to undertake a minimal number of changes to make the switch to XHTML. The W3C has supplied a comparison between HTML 4.0 and XHTML to aid in this transition. Typical modifications will probably include the following:

  • Use of lowercase HTML tags throughout, due to XML's case sensitivity. This means that elements such as <TABLE> or <BR> should be converted to <table> and <br>, respectively.

  • Non-empty elements must have end tags. To specify a new paragraph, many HTML developers simply use the <p> tag without a closing </p>. Like all XML documents, HTML requires that all elements include a beginning and ending tag and that they also be properly nested.

  • Empty elements must have an end tag, or the start tag must end with />. This means that line breaks such as <br> must now be coded as <br></br> or <br />. The latter example (<br />) will not be accepted by some HTML browsers, making the longer <br></br> syntax necessary.

Later in this article I'll mention a few tools to aid your transition. Before discussing those, however, let's look at a valid XHTML document.

  • + Share This
  • 🔖 Save To Your Account