The explanation from this tutorial are for those who already know HTML, presented in detail in previous lessons of this course.
XHTML (eXtensible HyperText Markup Language) has the same role and capabilities as HTML, it's a more advanced version of HTML, but with a slightly different syntax, more strict.
XHTML is a modern replacement for HTML, a combination between HTML and XML, it is almost identical to HTML 4.01.
The main difference that should be considered from HTML to XHTML is its syntax; all tags and attributes must be write in lowercase.
If you already know HTML, by following the rules of XHTML syntax, described below, can be said that you know XHTML too.

XHTML syntax rules

1)   For an XHTML document to be considered valid, a correct DTD must be added as the first line of the file.
A DTD (Document Type Definitions) contains the standard rules and the allowed syntax of the elements on the page.
There are three XHTML DTDs: Strict, Transitional and Frameset.
After one of these statements it should be added the code for XHTML document structure, as shown in the following example (the standard structure of an XHTML web page):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Page Title</title>
<meta name="description" content="Page description" />
<meta name="keywords" content="principal, keywords, in page" />
</head>
<body>
  ... The content of page that is displayed in the Web browser.
</body>
</html>

2)   Tag names and attributes must be in lower case.
3)   Attribute values must be quoted.
4)   Unlike HTML, where elements are closed with a second tag (identical), and some do not use closing tag, in XHTML all elements must be closed and there are specific elements which have singular closing, in the same tag .
In XHTMLIn HTML
<meta ... /><meta ...>
<br /><br>
<hr /><hr>
<input /><input>
<img ... /><img ...>
- Other items, such as:   <p> </p>, <div> </div>, <span> </span>, ..., etc., are identical.

5)   In XHTML, all elements must be properly nested within each other.
6)   All attributes must have a value.
In HTML there are attributes (like "checked") which are written without any value.
Here are some of the most common:
In XHTMLIn HTML
checked="checked"checked
declare="declare"declare
readonly="readonly"readonly
disabled="disabled"disabled
selected="selected"selected
nowrap="nowrap"nowrap
noresize="noresize"noresize

7)   The name attribute of the <a> and <map> tags was replaced with id.

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used to add definition lists into a <dl> element?
<dt> <dd> <li>
<dl>
 <dt>HTML</dt>
  <dd> - Hyper Text Markup Language</dd>
  <dd> - Language for web pages</dd>
</dl>
Which CSS property can hide an element on page, letting an empty space in its place?
display position visibility
#id {
  visibility: hidden;
}
Click on the event which is triggered when the mouse clicks on an object.
onclick onmouseover onfocus
document.getElementById("id").onclick = function(){
  alert("http://CoursesWeb.net/");
}
Indicate the PHP variable that contains the contents of both $_GET, $_POST, and $_COOKIE arrays.
$_SESSION $_GET $_REQUEST
if(isset($_REQUEST["id"])) {
  echo $_REQUEST["id"];
}
XHTML vs HTML

Last accessed pages

  1. Ajax-PHP File Manager (3571)
  2. Area and Perimeter Calculator for 2D shapes (5794)
  3. Super Mario Crossover (506)
  4. Flash Games - Free online Games (13206)
  5. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (54372)

Popular pages this month

  1. Bubbles3 (3136)
  2. Butterfly Kyodai (2748)
  3. Zuma Deluxe (2025)
  4. Qwop (1252)
  5. Backgammon (1197)