XHTML
What do I need to study this tutorial ?
You must have basic knowledge about HTML or HTML 4.01.
If you like to study HTML, visit my First Tutorial
First of all
Go to your website ... At any page right click ... Choose view source from the menu ... If you have this DOCTYPE at the first line :
Now we have What, Why and How :
What Is XHTML ?
Simply : XHTML is a stricter and cleaner version of HTML, and it is stands for EXtensible HyperText Markup Language
XHTML is HTML defined as an XML application and a W3C Recommendation
Why XHTML ?
What's the big deal?
It's all about to provide the highest level of service for your clients.
The code is clean, and Web browsers are able to display the page quicker than one with errors and unformatted code.
XHTML provides greater control over documents viewed in a variety of browsers and other devices, i.e. Mobiles Phones and small devices,
which leads to better accessibility. And we know that Better Accessibility leads to more page views and more visitors.
A well-written XHTML document is guaranteed to display in a standards-compliant browser
because All new browsers have support for XHTML and No longer do Web sites need to display the notice: "This page is best viewed with xxxx browser".
To Check Your Browser Version Click Here.
How to Converted To XHTML
1 - A DOCTYPE Definition must be included in all documents.
The following DOCTYPE declaration was added as the first line of every page:
IMPORTANT: Your pages must have a DOCTYPE declaration if you want them to validate as correct XHTML.
2 - Lowercase Tags And Attribute Names Since XHTML is case-sensitive, and only accept lowercase tags and attributes names.
3 - All Attribute Values Were Quoted The XHTML 1.0 Recommendation states that all attribute values must be quoted.
4 - Empty Tags: <hr> , <br> and <img> are not allowed in XHTML.
The <hr> and <br> tags should be replaced with <hr /> and <br />.
Do not close the <img> tags with </img>, but with /> at the end of the tag.
- all tags must be properly nested i.e : the first tag you opend is the last tag you close
- all tags must be closed
- the
<title>
tag must come first in the<head>
tag.
<html>
<head>
<title>Basic Document</title>
</head>
<body>
<p align="center">converting to XHTML.</p>
</body>
</html>
Now You Know XHTML, What's Next?
The next step is to learn CSS and JavaScript.
CSS
CSS is used to control the style and layout of multiple Web pages all at once.
With CSS, all formatting can be removed from the HTML document and stored in a separate file.
CSS gives you total control of the layout, without messing up the document content.
To learn how to create style sheets. Click Here
JavaScript
JavaScript can make your web site more dynamic.
A static web site is nice when you just want to show flat content, but a dynamic web site can react to events and allow user interaction.
JavaScript is the most popular scripting language on the internet and it works with all major browsers.
We will learn more about JavaScript In short time.