R4R provide basic XHTML Tutorials concept with
XHTML Examples .
Through R4R you can develop XHTML programming concept. R4R provide
XHTML Interview Questions with answers.R4R provide XHTML Languages study materials in easy way.
Introduction of XHTML:
XHTML stands for extensible HyperText Markup Language and is a cross between
HTML and XML.XHTML was developed by the W3C to help web developers make the
transition from HTML to XML.
XHTML was created for two main reasons:
The XHTMLFamily Tree
1. To create a stricter standard for making web pages, reducing
incompatibilities between browsers.
2. To create a standard that can be used on a variety of different devices
The Main Changes
There are several main changes in XHTML from HTML:
tags must be in lower case
2.All documents must have a doctype
3.All documents must be properly formed
4.All tags must be closed
5.All attributes must be added properly
6.The name attribute has changed
7.Attributes cannot be shortened
8.All tags must be properly nested
History of XHTML:
HTML was originally Developed by Tim Berners-Lee, now director of the World
Wide Web Consortium, keepers and communicators of most internet standards.
XHTML1 is a reformulation of HTML4, which was SGML-based, as XML. The changes
are of a mere syntactic nature and not visible to the end-user.
XHTML1 comes in three different flavors:
1 .Strict: no layout information is included, the
recommended way to implement pages.
2.Transitional: includes support for older, visual
elements, which are deprecated.
3. Frameset: includes support for frames, sub-areas
on a single site with parallel display of pages.
Difference Between HTML and XHTML:
- XHTML is case-sensitive, HTML is not. All tags and attributes must be
lowercase in XHTML.
- XHTML, being XML, must be well-formed. Every element must have an end tag,
or use the self-closing tag syntax. HTML allows some end tags and even some
start tags to be omitted.
- If an XML parser encounters a well-formedness error, it must abort. An
SGML or HTML parser is expected to try to salvage what it can and keep going.
- All attributes must have a value in XHTML. HTML allows some attributes
(e.g., selected) to be minimised.
- All attribute values must be surrounded by double or single quotes.
HTML allows quotes to be omitted if the value contains only alphanumeric
characters (and some others).
- The comment syntax is more limited in XHTML, but that's rarely an
issue for most designers/developers.
- XHTML uses XML parsing requirements. HTML uses its own which are defined
much more closely to the way browsers actually handle HTML today.
- In HTML, the doctype is required. In XHTML, it is optional.
- In XHTML, tag names and attribute names are case sensitive. In HTML, they
are case insensitive.
- In XHTML, non-empty elements require both a start and an end tag. In HTML,
certain elements allow the omission of either or both:
- HTML allows attribute minimisation (i.e. omitting the value), XHTML does
- HTML allows the use of unquoted attribute values, XHTML does not.
- XHTML allows the use of CDATA sections, HTML does not.
- XHTML allows the use of processing instructions, HTML does not.
Why we use XHTML:
We use XHTML because of some important reasons those are given
- XHTML can run on all new browsers.
- It is an combination of HTML and XML so,it support many important
features of them.
- XHTML also give us facilitty to write well formed document.
Advantage of XHTML:
- It is the first step toward a modular and extensible web based on XML.
- It provides the bridge for web designers to enter the web of the future,
while still being able to maintain compatibility with today's HTML 4 browsers.
- Develop sophisticated behaviors that work across multiple browsers and
- Comply with accessibility laws and guidelines without sacrificing beauty,
performance, or sophistication.
- Redesign in hours instead of days or weeks, reducing costs.
- It can be used by mobile devices.
- It is possible to use XML tools with it.
Show All Comments