HTML element
From Wikipedia, the free encyclopedia
In computing, an HTML element indicates structure in an HTML document and a way of hierarchically arranging content. More specifically, an HTML element is an SGML element that meets the requirements of one or more of the HTML Document Type Definitions (DTDs). These elements have properties: both attributes and content, as specified (both allowable and required) according to the appropriate HTML DTD (for example, the HTML 4.01 strict DTD). Elements may represent headings, paragraphs, hypertext links, lists, embedded media, and a variety of other structures.
Syntactically HTML elements are constructed with:
- a start tag marking the beginning of an element
- any number of attributes (and their associated values)
- some amount of content (characters and other elements)
- an end tag (note: Empty elements should not have an end tag. It is optional for some others.)
Many HTML elements include attributes in their start tags, defining desired behavior or indicating additional element properties. The end tag is optional for many elements; in a minimal case, an empty element has no content and requires no end tag. There are a few elements that are not part of any official DTDs, yet are supported by some browsers and used by some web pages. Such elements may be ignored or displayed improperly on browsers not supporting them.
Informally, HTML elements are sometimes referred to as "tags" (an example of synecdoche), though many prefer the term tag strictly in reference to the semantic structures delimiting the start and end of an element.
XHTML is the successor to HTML 4.01; XHTML 1.0 supports the same elements as HTML 4 and in most cases valid XHTML 1.0 documents will be valid or nearly valid HTML 4 documents. XHTML 1.0 migrates HTML from its SGML underpinnings to an XML foundation. Accordingly, the discussion of elements within this article focuses on the final SGML based HTML, version 4.01 (unless noted otherwise). However, to the extent that XHTML 1.0 elements remain identical to the HTML 4.01 elements, the discussion remains applicable (see HTML for a discussion of the minor differences in content between XHTML 1.0 and HTML 4.01).
| HTML |
|---|
Contents |
[edit] Head elements
<title>…</title>
- Define a document title. This element is required in every HTML and XHTML document. Different user agents may make use of the title in different ways. For example:
-
- It may become the default filename when saving the page.
-
- Search engines' Web crawlers may pay particular attention to the words used in the title.
- The
titleelement must not contain any nested tags (that is, it cannot contain any other elements). Only onetitleelement is permitted in a document.
<base>
- Specifies a base URL for all relative
hrefand other links in the document. Must appear before any element that refers to an external resource. HTML permits only onebaseelement for each document. Thebaseelement has attributes, but no contents.
<link>
- Specifies links to other documents, such as "previous" and "next" links, or alternate versions [1]. A common use is to link to external stylesheets, using the form
<link rel="stylesheet" type="text/css" href="url" title="description_of_style">[2]
A less-common, but important, usage is to supply navigation hints consistently through use of microformats. Several common relationships are defined, that may be exposed to users through the browser interface rather than directly in the web page.
-
<link rel="next" href="url">
- A document's
headelement may contain any number oflinkelements. Thelinkelement has attributes, but no contents.
<basefont> (deprecated)
- Specifies a base font size, typeface, and color for the document. Used together with
fontelements. Deprecated in favor of stylesheets.
<script>…</script>
- Used to add JavaScript or other scripts to the document. The script code may be typed literally between the
scripttags or may be given in a separate resource whose URL is specified with thescriptelement's optionalsrcattribute. [3]
<style>…</style>
- Specifies a style for the document, usually in the form
-
<style type="text/css">…</style>
-
- The CSS (Cascading Style Sheets) statements may be typed literally between the
styletags or may be given in separate resources whose URLs are specified with@importdirectives of the form-
<style> @import url; </style>. [4]
-
<object>…</object>
- Used for including generic objects within the document header. Though rarely used within a
headelement, it could potentially be used to extract foreign data and associate it with the current document.
<meta>
- Can be used to specify additional metadata about a document, such as its author, publication date, expiration date, page description, keywords, or other information not provided through the other header elements and attributes. Because of their generic nature,
metaelements specify associative key-value pairs.
- In one form,
metaelements can specify[edit] References
- ^ "Description of the BLACKFACE tag". Retrieved on 2008-07-31.
[edit] See also
- Microformat - use of abbr and attributes
[edit] External links
- Complete lists of elements and attributes for HTML 4.01
906 brak hosta niezarejestrowana strona 906 wymiana linkowONZ: Izrael najpierw ewakuował Palestyńczyków, a potem ich ostrzelał Przynajmniej 30 Palestyńczyków zginęło w Strefie Gazy w ostrzale domu, do którego zostali wcześniej ewakuowani przez izraelskich żołnierzy - wynika z raportu ONZ.
"Nie myślałem, że minister się tak prostytuuje" Posłanka PiS Grażyna Gęsicka, wzywając rząd do odpowiedzialności za niewykorzystanie funduszy unijnych manipuluje opinią publiczną - ocenił w TVN24 poseł PO Janusz Palikot.
Wypadek na drodze Wrocław-Legnica Jedna osoba została ranna w wyniku wypadku, do którego doszło w piątek wieczorem niedaleko miejscowości Mazurowice (Dolnośląskie). Droga krajowa nr 94 Wrocław - Legnica została całkowicie zablokowana.
Omar Faris: Niech Izrael opuści nasze ziemie - Niech Izrael opuści nasze ziemie, a gwarantujemy, że ani jedna rakieta nie spadnie na ich ziemie - mówił przewodniczący Palestyńskiej Koalicji na rzecz Prawa do Powrotu Omar Faris, gość CZATerii w INTERIA.PL.
Juszczenko: Konflikt gazowy był zaplanowany Ukraina pozwoli rosyjskim obserwatorom na wjazd na jej terytorium w celu nadzorowania tranzytu rosyjskiego gazu do Europy - poinformował prezydent Ukrainy Wiktor Juszczenko po spotkaniu z czeskim premierem Mirkiem Topolankiem w Kijowie.