demosthenes.info

I’m Dudley Storey, the author of Pro CSS3 Animation. This is my blog, where I talk about web design and development with , and . To receive more information, including news, updates, and tips, you should follow me on Twitter or add me on Google+.

web developer guide

my books

Book cover of Pro CSS3 AnimationPro CSS3 Animation, Apress, 2013

my projects

A Sass color keyword system for designers. Replaces CSS defaults with improved hues and more memorable, relevant color names.

CSSslidy: an auto-generated #RWD image slider. 3.8K of JS, no JQuery. Drop in images, add a line of CSS. Done.

tipster.ioAutomatically provides local tipping customs and percentages for services anywhere.

HTML abbr tag example

HTML Elements

html / elements

Estimated reading time: 1 minute, 22 seconds

The doctype goes first in the code of every web page you create. The code that follows it will usually be HTML, so we'll discuss that next.

is specified through the use of tags, also known as elements or markup.

Tags specify what content is. The thing defined by the tag – the content – is placed 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:

<p>This is a paragraph</p>

Note that the closing tag shows where the thing being talked about ends. Without the closing tag, everything that occurred after the opening <p> would be assumed to be continuation of the paragraph, unless that new content had specific markup of its own.

All tags can use attributes. Attributes are always written inside the opening tag, and almost always take the form x="y". Attributes add more information to the tag as to what it means. In the example in the header illustration for this article, we have defined the word SAIT Polytechnic to be an abbreviation by using the appropriate tag. The title attribute for the tag defines what SAIT stands for.

A few common rules for tags:

  • A tag is always specified between < (less than) and > (greater than) symbols.

  • After the less than symbol, a tag will always consist of at least one letter (the link tag <a> for example), although it may also include numerals (such as a heading element).

  • Tags should always be written in lowercase.

comments powered by Disqus

This site helps millions of visitors while remaining ad-free. For less than the price of a cup of coffee, you can help pay for bandwidth and server costs while encouraging further articles.