Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Types

This page describes the basic data types that may appear as an element's content or an attribute's value. For introductory information about reading the HTML DTD, please consult the W3C's SGML tutorial.

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.

Colors

A 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:
  • Specifying color directly in HTML is deprecated (slated for removal from the standards). You are encouraged to use style sheets instead.
  • Avoid color combinations that cause problems for people with color blindness.
  • If you use a background image or set the background color, then be sure to set the various text colors as well - users may set their own colors, some or all, and disallow background image loading. The possibility of ending up with some illegible combination such as black text on a black background is very real.
  • Colors specified with HTML elements may look different on different platforms (e.g., workstations, Macs, Windows, and LCD panels vs. CRTs), so you shouldn't rely entirely on a specific effect. In the future, support for the SRGB color model together with ICC color profiles should mitigate this problem.
  • When practical, adopt common conventions to minimize user confusion.

URLs

Text Strings

W3C: Basic HTML data types



Up to => Home / Authoring / HTML




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers