Jump to content

HTML syntax

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Huo Ma Ke (talk | contribs) at 19:30, 31 March 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

This page is for HTML syntax, NOT JUST HTML! Please do not redirect. There isn't any syntax on the main HTML page, so you cannot honestly redirect. Go to the talk page if you have an issue.

Tags

Basic Tags

html

<html></html> starts and ends an HTML document. It must be included in every HTML document, most likely at the beginning and end of the document.

<head></head> starts and ends the header section of any HTML document. This section is optional, but is highly recommended. It holds such information as the title of the page, the meta information (for search engines), and any scripts or stylesheets you may wish to use for your webpage.

body

<body></body> starts and ends the body of any HTML document. This section is also optional, though if you leave it out, there will be nothing for the browser to display!

p

starts and ends a basic paragraph. It provides a line break before and after the enclosed text, if there wasn't one already. This is the simplest and most used tag (excepting, perhaps, the <a> tag).

a

<a></a> denotes an anchor. Anchors can be used in several ways. The most common way is external links (like the ones at the bottom of your favorite Wikipedia article). These are usually made by typing <a href="External Link URL">External Link Name</a>. They are also used as anchors (duh) to parts of a page. Wikipedia uses these for sections (see the table up at the top of the page).