XHTML Script – What Is It?

valid XHTML script

Basically, XHTML is HTML defined and executed as XML. XHTML is written in similar to the HTML syntax, but stricter. XHTML combines the advantages of both XML and HTML, it’s supported by the majority of browsers and editors. The XHTML script is an extended version of HTML, which was introduced in 2000 to improve HTML’s flexibility and compatibility with other formats. However, there are some differences between the HTML and XHTML syntax and the way some other scripts are processed in XHTML (for example, CSS and Java Script, due to the case-sensitivity of XHTML). To make sure that the XHTML script is always properly executed and available for all browsers, some developers use only HTML-compatible XHTML.

Strict & Transitional XHTML DTD

transitional XHTML DTD

There are two basic XHTML DOCTYPE versions that are most commonly used for the creation of XHTML documents. These are the Strict and Transitional XHTML DTDs. The Strict XHTML is the standard one, it requires separate structure and presentation (no layout defining markup, the whole presentation should be in CSS). The Transitional XHTML DTD includes the presentation elements, it’s somewhere between the HTML and the Strict XHTML format. The Strict version is cleaner and the better long-time choice, but if your site visitors use older browsers and you don’t use much CSS, you may also use the Transitional XHTML DTD.

Valid XHTML and XHTML Syntax

tags XHTML doctype

If you want to write valid XHTML script you must observe a few rules. Unlike HTML, XHTML elements must be always closed, with closing XHTML tags (<p> and </p>) or single self-closing XHTML tags (</hr>). XHTML is case-sensitive, so the elements and attributes must be in lowercase. Unlike the HTML markup, XHTML attribute values must be always quoted. Attribute minimization or “short tags” isn’t allowed for XHTML. It’s absolutely necessary to define the XHTML DOCTYPE in the beginning of the document. These are the basic requirements. However, there are some parsing errors that might occur for XHTML files, so you should be always careful and make sure that you use valid XHTML script.

Free Website Hosting

free website hosting

Are you ready to start writing valid XHTML to improve your website? We offer various tools that will help you to launch your site quickly. Try our free website hosting or unlimited shared hosting. With shared web hosting you can get free CMSs, website builders, Python, Perl, Ruby, ASP.NET , SSI and more. Our plans start at $24.00£24.0024.00€ per year.

FREE Hosting Plan

$0.00£0.000.00€ per year

    1000 MB Disk Space
    5 GB Monthly Traffic
    1 Domain Hosting
    MySQL, SpamAssassin
    PHP5, Perl
    Advanced Control Panel
<< Go Back to Hosting Encyclopedia    
We use cookies to ensure you can get the best experience on our site. If you keep using this site we assume that you agree to our use of cookies. Privacy Policy OK