Information Technology Reference
In-Depth Information
< tagname > plain text or nested tags </ tagname >
Tags distinguish between an opening tag < tagname > and a closing tag
</ tagname > . 7 Attributes can be attached to opening tags in the form
< tagname attributename 1 ="value" ... attributename 1 ="value"> .Theal-
lowed tags and attributes for a particular SGML application such as HTML
are defined by document type definitions (DTDs).
The DTD for HTML defines tags and attributes for layout and for in-
terlinking text and multimedia documents. So, HTML is a description lan-
guage for the layout of documents, tailored for display in Web browsers, which
provides a portable format independent of the actual rendering in a specific
browser or other application. The general structure of an HTML document is
shown by a small example in Fig. 2.3.
< ! DOCTYPE HTML PUBLIC
//W3C//DTD HTML 4.01//EN”
”http://www.w3.org/TR/html4/strict.dtd” >
< html >
< head >
< title > Here goes the title of the document < /title >
< /head >
< body >
< ! −− Here could go arbitrary other HTML
text and formatting
instructions −−>
< h1 > Heading < /h1 >
< p > A paragraph in the document < em > body < /em > .
< h2 > Subheading within the document < /h2 >
< p > This is a
< a href=”http://www.wsmo.org/” > link < /a >
to the WSMO page.
< /body >
< /html >
Fig. 2.3. HTML document and corresponding layout in a Web browser
HTML and most browsers are tolerant of minor, sloppy mistakes such as
omitting closing tags. For example, the closing paragraph tag <P> in Fig. 2.3
is optional in HTML. Browsers often accept even invalid HTML and will try
to render it, although the W3C highly recommends that one should stick with
the standards when authoring an HTML page.
Basic features of HTML comprise:
linking to other documents or parts of documents;
structuring text (lists, tables, various levels of headings, etc.);
formatting text (italic/boldface/underlined, etc.);
adding graphics to the document;
creating simple user interfaces using forms (including radio buttons, text
fields, check boxes, etc.).
7 Note that in HTML it is not necessary that every tag must be closed: for instance,
<br> , denoting a new line.
Search WWH ::




Custom Search