demosthenes.info

A blog by Dudley Storey on , , , , , , and anything else that strikes his fancy.

featured articles

popular favourites

tag terms

HTML Elements

The doctype goes first in the code of every page you do from now on. The code that follows it will be HTML, so we need to discuss that next.

HTML is specified through the use of tags, also known as elements. A tag is specified between < (less than) and > (greater than) symbols. Tags specify what content is. The thing influenced by the tag – the content – is either inside the tag itself, or between opening and closing tags. With very few exceptions, the closing version of a tag is always the first word used in the opening tag with a slash (/) in front of it. For example, a paragraph would be specified as follows:

  1. <p>This is a paragraph</p>

Note that the closing tag shows where the thing being talked about (a paragraph, in this case) ends. Without the closing tag, everything that occurred after the opening <p> would be assumed to be a paragraph, unless it had specific markup of its own.

Most tags have attributes. Attributes are always written inside the opening tag, and almost always (with very few exceptions) take the form x="y". Attributes add more information to the tag: specifying how it appears, but adding information on what it means. In the example above, we have defined the word SAIT to be an acronym by using the appropriate tag. The title attribute for the tag defines what SAIT stands for.

web developer guide

featured comment

by JoelB in Goodbye, JQuery Validation: HTML5 Form Errors With CSS3

what i'm reading

A Storm of Swords: A Song of Ice and Fire: Book Three
A Storm of Swords: A Song of Ice and Fire: Book Three

what i'm watching

Californication: The Third Season
Californication: The Third Season

what i'm playing

Mass Effect 3 Collector's Edition
Mass Effect 3 Collector's Edition

what i'm hearing

Dub FX
Dub FX

blogs

podcasts

no ads ever

This blog is free of advertising, and always will be.

creative commons licensed

The content of this blog is free to use in whatever way you wish under the Creative Commons license.