HTML
From Web Design and Programming
| HTML | |
|---|---|
| MIME type: | text/html |
| File extensions: | html, htm |
| Description: | HyperText Markup Language |
HTML (HyperText Markup Language) is an SGML application used to create web pages.
Contents |
[edit] Content and presentation
When HTML was first created, several presentational elements were added in order to decorate and style web pages. Now that there is a stylesheet language (CSS), there's less need for presentational elements. The general idea is to keep the content in HTML and rely on CSS for presentation, although many times compromises are required.
[edit] The root element
All SGML documents must have a root element. HTML uses the <html> element as its root. HTML has no required attributes on the root element, but some people do use the dir and lang attributes. In XHTML, however, there are required attributes.
[edit] The main sections
In Markup Languages, if you have various grouping elements directly below the root element, they are called sections. In HTML, the sections are <head> and <body>.
The <head> element can be used for adding information about the document. Its descendants are not usually shown, however, there are cases where you can show them.
The <body> element contains the content of the document. This content looks the way the browser renders it by default. To style elements, look into CSS.
[edit] Document header
There are several important elements that you need for the <head> section.
[edit] Document title
To title the document, use the <title> element. In most browsers, this displays at the top of the window. In certain browsers, you can use CSS to make the title visible.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd"> <html> <head> <title>Title goes here</title>
That would be the start of your document.
[edit] Metadata and pseudo-HTTP headers
The <meta> element is an empty element that sends information to various user agents and creates fake HTTP headers in case you don't have a server-side scripting language.
[edit] See also
This HTML article is a stub. You can help by expanding it.
