HTML
HTML or HyperText Markup Language is the main markup language for
creating web pages and other information that can be displayed in a web
browser. HTML is written in the form of HTML elements consisting of tags
enclosed in angle brackets (like <html>), within the web page content.
HTML tags most commonly come in pairs like <h1> and </h1>, although some
tags represent empty elements and so are unpaired, for example <img>.
The first tag in a pair is the start tag, and the second tag is the end
tag (they are also called opening tags and closing tags). In between
these tags web designers can add text, further tags, comments and other
types of text-based content. The purpose of a web browser is to read
HTML documents and compose them into visible or audible web pages. The
browser does not display the HTML tags, but uses the tags to interpret
the content of the page.
Attributes
Most of the attributes of an element are name-value pairs, separated by
"=" and written within the start tag of an element after the element's
name. The value may be enclosed in single or double quotes, although
values consisting of certain characters can be left unquoted in HTML
(but not XHTML). Leaving attribute values unquoted is considered
unsafe. In contrast with name-value pair attributes,
there are some attributes that affect the element simply by their
presence in the start tag of the element, like the is map attribute for
the image element.
There are several common attributes that may appear in many elements:
The id attribute provides a document-wide unique identifier for an
element. This is used to identify the element so that stylesheets can
alter its presentational properties, and scripts may alter, animate or
delete its contents or presentation. Appended to the URL of the page, it
provides a globally unique identifier for the element, typically a
sub-section of the page. For example, the ID "Attributes" in
http://en.wikipedia.org/wiki/HTML#Attributes
The class attribute provides a way of classifying similar elements. This
can be used for semantic or presentation purposes. For example, an HTML
document might semantically use the designation class="notation" to
indicate that all elements with this class value are subordinate to the
main text of the document. In presentation, such elements might be
gathered together and presented as footnotes on a page instead of
appearing in the place where they occur in the HTML source. Class
attributes are used semantically in microformats. Multiple class values
may be specified; for example class="notation important" puts the
element into both the 'notation' and the 'important' classes.
An author may use the style attribute to assign presentational
properties to a particular element. It is considered better practice to
use an element's id or class attributes to select the element from
within a stylesheet, though sometimes this can be too cumbersome for a
simple, specific, or ad hoc styling.
The title attribute is used to attach subtextual explanation to an
element. In most browsers this attribute is displayed as a tooltip.
The lang attribute identifies the natural language of the element's
contents, which may be different from that of the rest of the document.
For example, in an English-language document:
<p>Oh well, <span lang="fr">c'est la vie</span>, as they say in
France.</p>
The abbreviation element, abbr, can be used to demonstrate some of these
attributes :
<abbr id="anId" class="jargon" style="color:purple;"
title="Hypertext Markup Language">HTML</abbr>
This example displays as HTML; in most browsers, pointing the cursor at
the abbreviation should display the title text "Hypertext Markup
Language."
Most elements also take the language-related attribute dir to specify
text direction, such as with "rtl" for right-to-left text in, for
example, Arabic, Persian or Hebrew
|