spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / xml / reference / xhtml

XHTML Tags Reference

ASP 3.0/.NET Developer
Jupitermedia
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
Developer News
MicrosoftÂ’s Automated Agent: Can We Talk?
Borland Finally Sells CodeGear
Red Hat Heads For The JON 2.0

XHTML is a reformulation of HTML 4 as an XML 1.0 application. The stricter nature of XML requires you to follow more rules than before when creating documents:

The most important rules for creating valid XHTML

Document Type Namespace
Description
Transitional <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
The more forgiving, more backwards-compatible version of XHTML
Strict <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
The more rigorous, more XML-style version of XHTML
Frameset <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN">
DTD for frames

Most commonly used tags in XHTML

XHTML tags
Basic tags
<html> Creates an XHTML document
<head> Defines the title and other information that is not part of the Web page itself
<body> Defines the Web page itself
Header tags
<title> Defines the page title, usually displayed in the browser's title bar
<base href="URI" /> Defines the base URL for this page
Body attributes
<body background="URI"> Sets the page background image.
<body bgcolor="rgb"> Sets the page background color, either by name ("black"), or hex value ("#RRGGBB").
<body text="rgb"> Sets the page text color.
<body link="rgb"> Sets the color for hyperlinks.
<body vlink="rgb"> Sets the color for visited (previously followed) links.
<body alink="rgb"> Sets the color for activated (clicked) links.
Block tags
<p>...</p> Defines a text paragraph.
<br /> Defines a forced linebreak.
<blockquote> Defines a quoted, indented text block.
<h1>...<h6> Defines a level 1-6 heading.
<div> Defines a page section.
<table> Defines a tabular section.
<form> Defines a Web form.
<ol> Defines an ordered list (1, 2, 3, ...).
<ul> Defines an unordered, bulleted list.
<li>...</li> Defines a list item in an ordered or unordered list.
<dl> Defines a definition list, with terms and their definitions.
<dt> Marks the term to be defined.
<dd> Marks the definition of the term.
Text formatting tags
<code>, <tt> Defines a fixed width font, teletype typewriter style.
<em>, <cite>, <i> Emphasises or cites a text passage, usually using italics.
<strong>, <b> Uses strong, boldface font.
<pre> Defines pre-formatted text, text flow not to be controlled by browser.
<font size="#" color="rgb"> Defines a new font for a text region.
Anchor tags (links)
<a href="url"> Defines a hyperlink to another Web page.
<a href="mailto:email@domain.tld"> Defines a hyperlink to an email recipient.
<a name="$"> Defines an anchor within the page.
<a href="#$"> Defines a hyperlink to an anchor on the same page.
Graphics tags
<img src="url" /> Includes an image from the given URL.
<hr /> Includes a horizontal rule.
<hr noshade="noshade" /> Includes a horizontal rule without a shadow.
Table tags
<table> Defines a table.
<tr> Defines a new table row.
<td> Defines a new table cell.
<th> Defines a new table header cell.
Table attributes
<table border="#" width="{#|%}"> Defines table border in pixels and width in pixels or percent.
<tr align="{l|c|r}" valign="{t|m|b}"> Defines horizontal and vertical alignment of a row.
<td align="{l|c|r}" valign="{t|m|b}"> Defines horizontal and vertical alignment of a cell.
<td colspan="#" rowspan="#"> Defines how many rows or columns a cell should span, default is 1.
<td nowrap="nowrap"> Defines a new table cell.
Frame tags
<frameset> Defines a set of frames.
<frameset rows="{#|%|*},{#|%|*}"> Defines rows in the set, either in pixels, percentage of width, or spanning the rest (*).
<frameset cols="{#|%|*},{#|%|*}"> Defines columns in the set, either in pixels, percentage of width, or spanning the rest (*).
<frame src="url" name="$" /> Defines a frame with a name and the URL for its content.
<noframes> Alternative information for browsers without frame support.
Form tags
<form action="url"> Defines a form which will be sent back to the action URL on submission.
<select name="$"> Defines a drop-down box, with enclosing options as items.
<select name="$" multiple="multiple" size="#"> Defines a multi-select box with {size} entries height, with enclosing options as items.
<option name="$">value</option> Defines items in select boxes.
<textarea cols="#" rows=#"> Defines a multiline text field with cols times rows characters.
<input type="text" name="$" /> Defines a single line text entry field.
<input type="checkbox" name="$" /> Defines a checkbox. The text for the checkbox follows the tag.
<input type="radio" name="$" value="$" /> Defines a radio button. The text for the button follows the tag. Buttons with the same name form a group of mutual exclusive buttons.
<input type="image" border="#" name="$" src="url" /> Defines a submit button using an image.
<input type="submit" value="$" /> Defines a submit button using value as the face text.
<input type="reset" /> Defines a button that resets the form to blank entries.

Key
#Integer number, usually pixels, sometimes characters
%Integer percentage value, followed by a percent sign
$String of alphanumeric characters, starting with a letter
{l|c|r}Horizontal alignment, one of "left", "center", or "right"
{t|m|b}Vertical alignment, one of "top", "middle", or "bottom"
rgbColor, specified by name ("black") or as RGB value ("#001122")
urlURL, usually http:// or file://

click here

http://www.internet.com

Produced by Michael Claßen


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Perl Pragma Primer · Implement Drag and Drop in Your Web Apps: Part 2 · How to Create an Ajax Autocomplete Text Field: Part 5
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
SQL Server 2005 Express Edition - Part 22 - Upgrading from Microsoft SQL Server Desktop Engine (MSDE) · Vyatta: Downgrades that Pay Off · NetMotion Brings Cross-Network Support to Wireless VoIP

URL: http://www.webreference.com/xml/reference/xhtml.html
Created: Mar 19, 2001
Revised: Mar 19, 2001