| ★ wanayoo — archive 1999 http://wdvl.internet.com/Authoring/HTML/Types/ | Nouvelle recherche | Portail wanayoo |
|
||||
Types
Elements, Tags, and Attributes
A tag is
SGML markup that delimits
an element.
A tag includes a name which refers to an element declaration
in the DTD,
and include attributes.
SGML
Tags are used to define elements in
HTML.
Most tags have both a
start tag,
such as <LI> and a corresponding
end tag,
such as</LI>.
Typographic tags like
<B> for "bold" or <I>
for "italic" describe the appearance of the text;
idiomatic tags like
<EM> for "emphasize" or
<STRONG> for "strongly emphasize" describe the
reason for the appearance change.
Different browsers may choose different appearances for the same
idiomatic tag.
Tags specify structural elements in a document, such as headings:
<h2> Elements, Tags and Attributes </h2>Tags begin with a left-angle bracket < and end with a right-angle bracket >. The first word between the angle brackets is the element's name. Any further words and characters are the attributes, e.g. align=right. An element comprises three parts: a start tag, content, and an end tag. The element's name appears in the start tag (written <element-name>) and the end tag (written </element-name>); note the slash before the element name in the end tag. <Title>Elementary HTML</Title>In the example we are looking at the TITLE element, which has an opening and a closing tag. Some HTML element types allow authors to omit end tags. A few element types also allow the start tags to be omitted; for example, HEAD and BODY. Some HTML element types have no content. For example, the line break element BR has no content; its only role is to terminate a line of text. Such "empty" elements never have end tags. Elements may have associated properties, called attributes, which may have values (by default, or set by authors or scripts). Attribute/value pairs appear before the final ">" of an element's start tag. Any number of (legal) attribute value pairs, separated by spaces, may appear in an element's start tag. They may appear in any order. Tags are case-insensitive. You can write them in small letters, big letters, or any mixture. A common convention is to write them in caps so they stand out from the rest of the document. Tags should nest properly: if you want for example to make a part of the header in italics: <h2> Tags <i>and</i> Attributes </h2> Also, HTML documents are free-format - you can use spaces and tabs anyhow you like, and break lines anywhere. White space and line breaks will not affect the document appearance in a browser except when used inside certain special tags which we'll describe later. Some people find HTML can be hard to read. This need not be so if it's written tidily. My own preference is to indent the text by one tab, so that the source has a left margin. Structural tags can then be placed in the margin, and it's easy to read the source. Look at the source of this page to see what I mean. Browsers allow a great deal of flexibility about which tags you need to put into a web page. If you are designing your pages for only one browser that may be fine, but as soon as you want to support several browsers then you might want to look into validation, which is the process of checking HTML documents against the standards. ColorsA color value may either be a hexadecimal number (prefixed by a hash mark) or one of the sixteen pre-defined color names. The color names are case-insensitive. Thus, the color values "#800080" and "Purple" both refer to the color purple. Although colors can add significant amounts of information to documenst and make them more readable, please consider the following guidelines when including color in your documents:
URLsText StringsW3C: Basic HTML data types | ||||
Instantly look up a "techie" word using
Webopedia!!
|
internet.com
| |
e-commerce
| |
WebDeveloper Network
|
Copyright 1999 internet.com Corporation. Legal Notices. Privacy Policy.