If someone just says that this is the high time when you should convert your site from HTML to XHTML - you can halt or not. But if he can say this with proper logic then you must be going through his decision - adaptibility is another thing. So at first you must know basically what XHTML is. XHTML is really more similar to HTML than it is different. The "changes" aren't really changes, but just a set of stricter standards to obey. XHTML stands for Extensible HyperText Markup Language. XHTML is a cross between HTML and XML. Any XHTML document will be valid HTML and valid XML, which means it can be opened in any XML editor.
Why the need for XHTML?
- XML allows the developer to add new tags whenever they want, allowing for more flexibility and creativity.
- XHTML can be mixed with XML to provide easy updatable websites.
- New ways of accessing the Internet are being created every day. XML/XHTML is a common standard for all these browsers/clients, which stops different standards being created for each of these methods.
- XHTML is going to replace HTML in the near future so it will be useful if you already use it, as you will have one over on everyone who has stuck to using HTML.
New Doctype Declaration
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/">
And the tag becomes:
<html xmlns="http://www.w3.org/1999/" xml:lang="en" lang="en">
Just Some Rules
1. In the <head> tag the <title>Title here</title> tag must be first, nothing else
2. All tags must be lowercase, so no <TITLE> it must be <title>.
3. Any tag that doesn't have an ending tag, like <br>, must have a space and forward slash before the end like this: <br />.
4. All tag attributes must be surrounded by quotes, so replace <p align=center> with <p align="center">.
5. No attribute can have no value, so, for example, when using the <input> tag with checked at the end, you must change it to checked="checked".
6. All XHTML documents have to be well formed, so each file must have a html, head, title and body set of tags.
7. All documents must have a doctype, see above to find out the best one to use when you are new to XHTML.
Related Articles
- XHTML vs. HTMLA quick introduction to XHTML
- Why You Shouldn't Be Using XHTMLA lot of people these days are using XHTML. Why? Do they actually need it or are they just following a trend?
- What is XHTML?We have all heard of HTML. HTML stands for Hypertext Markup Language. What is a hypertext markup language, you ask? It is a language for specifying how certain text should appear. When you design a web page, you want certain content or text to be displayed in a specific way.
- Comprehensive Guide to XhtmlSince some time, the internet has been relying on HTML... or Hyper Text Markup Language... Since its been invented, many tries to replace it have been thought up, but none as successfull as XHTML (eXtensive Hyper Text Markup Language)... lets say that its HTML cleaned up...
- XHTML bridges the gulf between HTML and XMLBringing XML to todays HTML-based Web, XHTML justifies the breakthrough label. It will rise slowly but surely. If you take any interest in Web technology, youll have come across references to...
- Code Validation & Compliancy - The New Beginning XHTMLCode validation is still widely debated as to whether it is required for performance within the search engines. It is only a guess that the search engines dont utilise it within their algorithm, but nobody is actually 100% sure on that fact...
- XHTML and StylesheetsWant to build website content that can be processed by XML-compliant tools? If you answered yes, then its time to learn the rules governing XHTML.
- Why is Validation Important?Validation in your webpages is very important as proven in this tutorial. In this tutorial youll learn about Validation and how you should be making the effort to get validated!
- highlight_string(); With Valid XHTML 1.0 Strict OutputThis small guide aims to take the standard output from the PHP function highlight_string() and make it completely valid XHTML 1.0 Strict.
- Server Side IncludesThis very helpful tutorial makes it much easier to make changes throughout your entire website. It is easy to follow and has plenty of code.
