Showing posts with label XHTML. Show all posts
Showing posts with label XHTML. Show all posts

Thursday, October 14, 2010

XHTML Tag List

 XHTML tags are used to mark-up XHTML elements .XHTML tags are case sensitive, All tags in XHTML come in pairs for example <b> and </b>. The text that lies between the start tag and the end tag is called the element content.In these pair of tags,the first tag is the start tag,and the second tag is called end tag

DTD: indicates in which XHTML 1.0 DTD the tag is allowed. S=Strict,F=Frameset & T=Transitional

Tag Description DTD
<!--...--> Defines a comment STF
<!DOCTYPE>  Defines the document type STF
<acronym> Defines an acronym STF
<abbr> Defines an abbreviation STF
<a> Defines an anchor STF
<address> Defines an address element STF
<area> Defines an area inside an image map STF
<applet> Deprecated. Defines an applet TF
<basefont> Deprecated. Defines a base font TF
<base> Defines a base URL for all the links in a page STF
<b> Defines bold text STF
<big> Defines big text STF
<bdo> Defines the direction of text display STF
<blockquote> Defines a long quotation STF
<br> Inserts a single line break STF
<body> Defines the body element STF
<button> Defines a push button STF
<center> Deprecated. Defines centered
text
TF
<caption> Defines a table caption STF
<cite> Defines a citation STF
<col> Defines attributes for table columns  STF
<code> Defines computer code text STF
<dd> Defines a definition description STF
<colgroup> Defines groups of table columns STF
<dir> Deprecated. Defines a directory
list
TF
<del> Defines deleted text STF
<dfn> Defines a definition term STF
<div> Defines a section in a document STF
<dt> Defines a definition term STF
<dl> Defines a definition list STF
<em> Defines emphasized text  STF
<fieldset> Defines a fieldset STF
<form> Defines a form  STF
<font> Deprecated. Defines text font,
size, and color
TF
<frameset> Defines a set of frames F
<frame> Defines a sub window (a frame) F
<h1>
to <h6>
Defines header 1 to header 6 STF
<head> Defines information about the document STF
<i> Defines italic text STF
<html> Defines an html document STF
<img> Defines an image STF
<hr> Defines a horizontal rule STF
<iframe> Defines an inline sub window (frame) TF
<input> Defines an input field STF
<ins> Defines inserted text STF
<isindex> Deprecated. Defines a
single-line input field
TF
<label> Defines a label for a form control STF
<kbd> Defines keyboard text STF
<legend> Defines a title in a fieldset STF
<li> Defines a list item STF
<link> Defines a resource reference STF
<meta> Defines meta information STF
<map> Defines an image map  STF
<noframes> Defines a noframe section TF
<menu> Deprecated. Defines a menu list TF
<noscript> Defines a noscript section STF
<optgroup> Defines an option group STF
<object> Defines an embedded object STF
<ol> Defines an ordered list STF
<option> Defines an option in a drop-down list STF
<pre> Defines preformatted text STF
<p> Defines a paragraph STF
<param> Defines a parameter for an object STF
<q> Defines a short quotation STF
<samp> Defines sample computer code STF
<s> Deprecated. Defines
strikethrough text
TF
<script> Defines a script STF
<small> Defines small text STF
<strong> Defines strong text STF
<select> Defines a selectable list STF
<span> Defines a section in a document STF
<strike> Deprecated. Defines
strikethrough text
TF
<style> Defines a style definition STF
<sup> Defines superscripted text STF
<sub> Defines subscripted text STF
<table> Defines a table STF
<tbody> Defines a table body STF
<thead> Defines a table header STF
<td> Defines a table cell STF
<textarea> Defines a text area STF
<tfoot> Defines a table footer STF
<th> Defines a table header STF
<title> Defines the document title STF
<xmp> Deprecated. Defines preformatted
text
<tt> Defines teletype text STF
<tr> Defines a table row STF
<u> Deprecated. Defines underlined
text
TF
<var> Defines a variable STF
<ul> Defines an unordered list STF

XHTML Comments

You can add comments to XHTML documents to remind yourself or a document of what others were trying to make a web page. XHTML comments are just the source code of the page and is invisible to your users page - that is, the browser ignore the XHTML content of the comments. XHTML comment is an example of this:

e.g:
<html>
    <head>
    </head>
    <body>
        <h1>This is XHTML comment</h1>
        <p>XHTML comments are a useful way for Web developers</p>
        <!-- This is XHTML comment -->
    </body>
</html>

XHTML Encoding

XHTML files, and any other text file is stored using a particular character encoding. Since there are many different character encoding in the world, and have no idea what the settings in your default browser of the visitor, always a good idea to explicitly what the encoding used to make your web page . Here is an example of how to declare the character encoding, in this case, the Unicode encoding is used:
e.g:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

When the browser sees this tag, it will know that the page is UTF-8, and displays the correct. XHTML requires that you declare the encoding, if it is something different then the default UTF-8 or UTF-16. You can also use XML defines the character encoding. Some character encodings are almost identical.

International Character Set Codes
World Wide Web Consortium (W3C) recommends the use of UTF-8 if possible - UTF-8 can be used in all languages, and is recommended charset on the Internet. Support is growing fast. However, here is a partial list of countries,languages, & the older characters are generally used for:


Language (country)

Charset

Afrikaans (AF)

iso-8859-1, windows-1252

Catalan (CA)

iso-8859-1, windows-1252

Bulgarian (BG)

iso-8859-5

Basque (EU)

iso-8859-1, windows-1252

Byelorussian (BE)

iso-8859-5

Croatian (HR)

iso-8859-2, windows-1250

Czech (CS)

iso-8859-2

Danish (DA)

iso-8859-1, windows-1252

Dutch (NL)

iso-8859-1, windows-1252

English (EN)

iso-8859-1, windows-1252

Finnish (FI)

iso-8859-1, windows-1252

Albanian (SQ)

iso-8859-1, windows-1252

Esperanto (EO)

iso-8859-3*

Estonian (ET)

iso-8859-15

Hungarian (HU)

iso-8859-2

Faroese (FO)

iso-8859-1, windows-1252

Hebrew (IW)

iso-8859-8

French (FR)

iso-8859-1, windows-1252

Galician (GL)

iso-8859-1, windows-1252

German (DE)

iso-8859-1, windows-1252

Icelandic (IS)

iso-8859-1, windows-1252

Inuit (Eskimo) languages

iso-8859-10*

Macedonian (MK)

iso-8859-5, windows-1251

Irish (GA)

iso-8859-1, windows-1252

Italian (IT)

iso-8859-1, windows-1252

Japanese (JA)

shift_jis, iso-2022-jp, euc-jp

Korean (KO)

euc-kr

Latvian (LV)

iso-8859-13, windows-1257

Lapp

iso-8859-10* **

Lithuanian (LT)

iso-8859-13, windows-1257

Portuguese (PT)

iso-8859-1, windows-1252

Maltese (MT)

iso-8859-3*

Polish (PL)

iso-8859-2

Norwegian (NO)

iso-8859-1, windows-1252

Serbian (SR) latin

iso-8859-2, windows-1250

Swedish (SV)

iso-8859-1, windows-1252

Russian (RU)

koi8-r, iso-8859-5

Romanian (RO)

iso-8859-2

Serbian (SR) cyrillic

windows-1251, iso-8859-5***

Turkish (TR)

iso-8859-9, windows-1254

Slovak (SK)

iso-8859-2

Slovenian (SL)

iso-8859-2, windows-1250

Spanish (ES)

iso-8859-1, windows-1252

Scottish (GD)

iso-8859-1, windows-1252

Ukrainian (UK)

iso-8859-5

Arabic (AR)

iso-8859-6



XHTML DOCTYPES

There are three current flavors of both HTML 4 and XHTML 1.0: strict, transitional, and frameset. These different levels of support for XHTML are designed to help separate a web page, design of the structure - in essence, the W3C was the allocation of items for the eventual withdrawal of the specifications. XHTML Strict is characterized by the ban of these tags is called depricated. The two levels of support frames and the transition will depricated labels, with the only difference that allows the use of HTML frames.

XHTML 1.0 Strict:
If you plan to use strictly Cascading Style Sheet and does not write most of the XHTML attributes so it is recommended to use this DTD. A document in accordance with this DTD will be better.
If you want to use DTD XHTML 1.0 Strict then you need to put the following in the top of the XHTML document.

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

XHTML 1.0 Transitional:
If you plan to use a number of XHTML attributes as well as a few CSS style sheet, you should accept this DTD, and you should write a document based on DTD XHTML.
If you want to use XHTML 1.0 Transitional DTD then you need to pur following line at the top of your XHTML document.

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

XHTML 1.0 Frameset:
You can use it when you want to use HTML Frames to partition the browser window into two or more frames.
If you want to use XHTML 1.0 Frameset DTD then you need to pur following line at the top of your XHTML document.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

XHTML vs HTML

XHTML is not very different from the HTML 4.01 standard.So, bring your code up to 4.01 standard is a good start.

Given the fact that XHTML is an XML application, certain practices that were perfectly legal in SGML-based HTML 4 has been amended accordingly. You've already seen the XHTML syntax in the previous chapter, then the differences in XHTML and HTML are very clear:

XHTML documents must be well formed:
This means that all elements must have closing tags and all the elements must nest properly.
e.g:
<p>XHTML documents must be well formed:</p>

Attribute names must be in lower case:
XHTML documents must use lower case for all the names of HTML elements and attributes. This distinction is necessary because the document is considered XML XHTML, XML, and uppercase and lowercase letters.
e.g. <p>.....</p>  

Document is a XHTML DOCTYPE declaration at the top of the document. 
e.g: 
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>XHTML</title>
</head>

<body>
</body>
</html>



  All the attribute values must be quoted.

All attribute values must be quoted, even those which appear to be numeric.
e.g:
<td rowspan="3">

Wednesday, October 13, 2010

XHTML Syntax

XHTML syntax is very similar to HTML syntax, and almost all HTML elements are valid in XHTML as well. But when you write an XHTML document must pay a little more attention to your HTML document to XHTML compliance.

Here are important things to remember when writing a new XHTML document, or edit the HTML document, an XHTML document:
  • document is a XHTML DOCTYPE declaration at the top of the document.
  • Attribute names must be in lower case
  • All XHTML tags will have their end tags.
  • All the attribute values must be quoted.
  • Id attribute replaces the name attribute.
  • All tags must be properly nested

XHTML

XHTML is the next generation of HTML and is a hybrid between HTML and XML.

XHTML stands for Extensible HyperText Markup Language.
XHTML is a stricter and cleaner version of HTML .


XHTML is almost identical to HTML 4.01 with only a few differences. This version is cleaner and more strict HTML 4.01.XHTML was developed by the W3C to help Web developers make the transition from HTML to XML. By migrating to XHTML today, web developers in the XML world with all its benefits, but still feel safe on their content and backward compatibility.
Developers to migrate their content to XHTML 1.0 will realize the following benefits:
  • XHTML compliant XML documents. As such, they are easily viewed, edited and validated with standard XML tools.
  • XHTML documents can be written to work better than before in the existing browsers as well as new browsers.