5 avg. rating (100% score) - 5879 votes
XHTML stands for Extensible Hyper-Text Markup Language. XHTML is a scripting language that authors can use to embed text tags into a text document to add structural and formatting information.
More precisely, XHTML gives authors the means to:
An XHTML document is a normal text file with predefined tags mixed with the text contents of the document. Tags are enclosed in pairs of angle brackets: "<" and ">".
Below is how a simple XHTML document will look like if you open it in a text editor:
<?xml version="l.O" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtmll/DTD/xhtmll-strict.dtd">
<title>My First XHTML Document</title>
HTML (Hyper-Text Markup Language) is the original markup language for writing Web documents.
XHMTL 1. 0 is basically the same language as HTML 4. 0. But XHTML 1.0 is defined in XML1.0 syntax. XHTML 1.0 offers the following features:
XML (Extensible Markup Language) is a generic markup language to organize generic information into a structured document with embedded tags.
XHTML is entirely based on XML. You can actually say that XHTML is a child language of XML.
The Web is a publisher technology based on the Internet to allow publishers to publish hyper linked documents to be viewed by Internet users.
XHTML is the next generation language that used to compose those hyper linked documents. In another word, XHTML is the technical language that controls Web page contents and hyper links.
URL (Uniform Resource Locator) is a compact string representation of the location for a Web document or other resource that is available on the Internet.
The URL of an XHTML document is usually the document file name prefixed with the domain name of your Web server and the http protocol name. As soon as you uploaded an XHTML document to a Web server, that document will have a URL to represent its location on the Internet.
For example: if you have a Web server with domain name like wisdomjobs.com, and you have uploaded an XHTML document called welcome.html,then the URL of that XHTML document on the Internet is http://www.wisdomjobs.com/html
SGML (Standard Generalized Markup Language) is a metalanguage in which one can define markup languages, like HTML, for documents. SGML is a descendant of IBM's Generalized Markup Language (GML), developed in the 1960s by Charles Goldfarb, Edward Mosher and Raymond Lorie (whose surname initials also happen to be GML).
XHTML is not directly related to SGML. But it is indirectly to SGML through HTML.
CSS (Cascading Style Sheets) is a technical specification that allows XHTML document authors to attach formatting style sheets to XHTML documents. When XHTML documents are viewed as Web pages through Web browsers, the attached style sheets will alter the default style sheets embedded in browsers.
DTD (Document Type Definition) is a language based on XML to you to define a specific type of XML documents.
Since XHTML is a specific type of XML documents, you can use DTD to define the structure of XHTML.
An element attribute is a predefined property about this element. Element attributes allows you to provide additional information to the element. Most XHTML elements have some common attributes. But many XHTML elements have their own specific attributes.
Here are some good examples of element attributes:
<br/> - No attribute.
<p class="sideNote"> - One attribute: "class".
<meta name="Author" content="globalguideline.com"/> - Two attributes: ~ <img src="ggl.gif'' alt="ggl"/> - Two attributes: "src" and "alt".
Yes, XHTML element names are case sensitive. All element names must be written in lower case letters.
Here are some valid and invalid XHTML element names:
<html> - Valid name.
<HTML> - Invalid name, must use lower case letters.
<xhtml> - Invalid name, not defined by XHTML specification.
<Body> - Invalid name, must use lower case letters.
Note to HTML document authors: HTML element names are not case sensitive. But XHTML element names are case sensitive. If you are converting existing HTML documents to XHTML documents, you will get a lots of syntax errors about upper case letters used in HTML tags.
Most ofXHML elements allow you to specify contents. But there are some XHTML elements that do not allow any contents. If an XHTML element does allow element content, you need to enter the content between the opening tag and the closing tag.
Here are some good examples ofXHTML elements with contents:
~ <title>My First XHTML Document</title>
~ <p> A very long paragraph ... </p>
~ <hl> XHTML Tutorials by wisdomjobs.com/html</hl>
If you are converting existing HTML documents to XHTML format, you may find some <meta>
tags are written as:
<meta name="Author" content="wisdomjobs.com">
content="Tutorials, FAQs and Tips on XHTML Documents.">
content="XHTML Tutorials, FAQs, Tips">
But all those <meta> tags are invalid in a XHTML document. They must be closed as:
<meta name="Author" content="wisdomjobs.com"/>
content="Tutorials, FAQs and Tips on XHTML Documents."/>
content="XHTML Tutorials, FAQs, Tips"/>
Note to HTML document authors: <meta> tag syntax in XHTML is the opposite to <meta> tag syntax in HTML. In XHTML, meta tag must be closed. But in HTML, meta tag can not be closed.
If you are used HTML syntax, you may write your <br> tags as in the paragraph below:
I love the way you look at me, <br> Your eyes so bright and blue.<br>
I love the way you kiss me,<br>
Your lips so soft and smooth.<br>
But that paragraph will be invalid as XHTML documents, because all 4 <br> are not closed. You should change it to:
I love the way you look at me, <br/> Your eyes so bright and blue.<br/>
I love the way you kiss me,<br/> Your lips so soft and smooth.<br/>
Every XHTML element must be closed. There are two ways to close an XHTML element:
Using a closing tag, which is the element name prefixed with"/" and enclosed in a pair of angle brackets: "<"and">".
Closing the opening tag immediately by placing "/" before the ending bracket: ">".
Here are some good examples of closing XHTML elements:
<html> </html>- Closing the html element with a closing tag.
<head> </head> - Closing the head element with a closing tag.
<title/> - Closing the title element immediately with no content.
<body> ... </body> - Closing the body element with a closing tag.
<p> ... </p> - Closing the p element with a closing tag.
<script/> - Closing the script element immediately with no content.
When you are writing an XHTML element, you must start with its opening tag, which contains the name of the element and attributes if needed. The opening tag is enclosed in a pair of angle brackets:"<" and">".
XHTML element names are predefined by the XHTML specification.
You can not make up your own tag names. Here are some good examples ofXHTML element opening tags:
<html> - Opening tag of the html element.
<head> - Opening tag of the head element.
<title> - Opening tag of the title element.
<body> - Opening tag of the body element.
<p> - Opening tag of the p element.
<script> - Opening tag of the script element.
If you want to enter comments into an XHTML document, you can use the comment tag: "<!-- ...
Here are some good examples ofXHTML comments:
<!-- Start north banner--> ...
<!-- alert("Are you ok?"); -->
<!--A long . paragraph .
of comments--> ...
An XHTML element is the basic building block of an XHTML document. An XHTML element has the following features:
An XHTML element must have a name.
An XHTML element may have zero or more attributes.
An XHTML element may or may not have any content. Here is a good example of an XHTML element:
<a href="http ://www. glo balguideline. com/">globalguideline. com</ a>
The above an XHTML element has:
The basic tool you need to view XHTML documents is any Web browser, like Internet Explorer(IE) or FireFox.
The following tutorial shows you how to view a XHTML document with :
Here is a how your XHTML document, hello.html, will look like if viewing it with IE: Hello in IE.
The basic tool you need to write XHTML documents is any text editor, like notepad on Windows system, or vi on Unix system.
If you are looking for some advanced tools to help you writing XHTML documents, you can select any one from the following three categories of XHTML editors:
Text based editor: Allows you to work on the text version of the XHTML document.
WYSIWYG editor: Allows you to work on the rendered version of the XHTML document.
Browser based editor: A WYSIWYG editor integrated into an existing Web browser.
If you have just finished a new XHTML document, and you want to make sure that confirms with the XHTML specification.
There are 3 ways you can use this validator:
By URL: Specify the URL where your XHTML document is located, and click "Check".
By File Upload: Use the "Browse" to locate an XHTML document on your local hard disk, and click "Check".
By Direct Input: Copy & paste the content of an XHTML document to the input area, and click "Check".
The validator will return a page with validation result.
There are 77 tags defined in XHTML 1.0:
a abbr acronym address area b base bdo big blockquote body br button caption cite code col colgroup dd del dfn div dl dt em fieldset form hl h2 h3 h4 h5 h6 head hr html i img input inskbd label legend li link map meta noscript object oloptgroup option p param pre q samp script select small span strong style sub sup table tbody td textarea tfoot th thead title tr tt ul var.
The latest XHTML specification is XHTML 1. 0 second edition revised in August, 2002 by W3C.
XHTML was developed by W3C HTML Working Group with Steven Pemberton as the group chair.
XHTML Related Tutorials
|XML Tutorial||HTML 4 Tutorial|
|HTML Tutorial||HTML 5 Tutorial|
|Java Tutorial||CSS Tutorial|
XHTML Related Interview Questions
|XML Interview Questions||HTML 4 Interview Questions|
|HTML Interview Questions||HTML 5 Interview Questions|
|HTML DOM Interview Questions||Java Interview Questions|
|CSS Interview Questions||Java Abstraction Interview Questions|
|Dynamic HTML Interview Questions|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.