An example |
Without worrying about the details, you can get a general idea of what HTML markup looks like from the following short HTML source file:
<html> <head><title>An example</title></head> <!-- the title normally displays in the browser's title bar --> <body> <h1>Getting started</h1> <p> Learning the news of Napoleon's defeat at Borodino, Talleyrand is supposed to have said: </p> <blockquote> <p><em>Voilà le commencement de la fin.</em> </p></blockquote> <p> In English, this means: ``This is the beginning of the end.'' </p> </body> </html>
Here is how your Web browser formats this HTML code:
Learning the news of Napoleon's defeat at Borodino, Talleyrand is supposed to have said:
Voilà le commencement de la fin.
In English, this means: ``This is the beginning of the end.''
Compare the HTML code with the formatted output to get an
idea of how HTML works. Notice that HTML markup "tags"
come in pairs marking the beginning and the ending of a logical
structure: for example, <em>
this is emphasized
text</em>
. Tags are surrounded with angle brackets,
and the end tag differs from the start tag by having a forward
slash /
(not to be confused with the backslash \
that LaTeX uses to mark its control
sequences). It does not matter if tags are written in
upper-case letters or in lower-case letters: EM
is the
same as em
; however, using lower-case tags is a good
idea for future compatibility with XHTML.
Here are some items to notice about this simple example.
HTML has six levels of section headers, labeled h1
through h6
.
Unlike LaTeX, which uses a blank line to
signal a new paragraph, HTML insists on paragraphs being
marked explicitly with the <p>
tag. In general,
HTML ignores extra white space in the input file.
To mark special character entities, HTML uses special
sequences of characters starting with an
ampersand and ending with a semicolon: for
example, é
turns into é and ö
turns into ö (LaTeX would code these as
\'e
and \"o
). The ampersand itself requires
special treatment: for example,
"Texas A&M University
"
must be coded in HTML as
"Texas A&M University
".
A complete list of named character
entities is available;
note, however, that some browsers do not yet support
mathematical symbols.
An example |