FANDOM


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.

Content and presentationEdit

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.

The root elementEdit

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.

The main sectionsEdit

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.

Document headerEdit

There are several important elements that you need for the <head> section.

Document titleEdit

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.

Metadata and pseudo-HTTP headersEdit

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.

See alsoEdit

This HTML article is a stub. You can help by expanding it.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.