« Barbarism revisited | Main | Semantics in HTML »

January 08, 2007

Built in Semantics in HTML

I've been working on some things to do with semantics on the web, in particular in relation to HTML. As part of this, I've put together a list of all the elements and attributes of HTML that I consider have strong semantics ass ociated with them. I'd be interested in people's thoughts - any missing? Any of these not really "semantic"?

Thanks for your thoughts,

john

p.s. this will be published permantently online, as will the article I'm working on.

This is a rough and ready analysis of the built in semantics of HTML. I've left out the semantics of tables and their associated elements and attributes, as these are specific to one kind of markup (tabular data), as opposed to markup more generally. It by no means implies that such markup is not "semantic" (when used appropriately it of course is). Similarly, markup for forms is excluded, and again, of course this markup is semantic when used appropriately. I've also excluded deprecated elements and attributes, regardless of whether they are semantic or presentational. In addition, I've left out included (or "replaced" content (such as object, and img)). My reasoning here is that these are not so much for marking up content, and "transcluding" it from elsewhere.

Elements

a
Each A element defines an anchor
abbr
Indicates an abbreviated form
acronym
Indicates an acronym
address
The ADDRESS element may be used by authors to supply contact information for a document or a major part of a document such as a form
blockquote
BLOCKQUOTE is for long quotations (block-level content)
cite
Contains a citation or a reference to other sources
code
Designates a fragment of computer code

dfn

Indicates that this is the defining instance of the enclosed term


div, span

The DIV and SPAN elements, in conjunction with the id and class attributes, offer a generic mechanism for adding structure to documents

dl, dd, dt

Definition lists, created using the DL element, generally consist of a series of term/definition pairs (although definition lists may have other applications). The term is given by the DT element and is restricted to inline content. The description is given with a DD element that contains block-level content

del, ins

INS and DEL are used to markup sections of the document that have been inserted or deleted with respect to a different version of a document

em
Indicates emphasis

h1 .. h6

A heading element briefly describes the topic of the section it introduces

kbd

Indicates text to be entered by the user

ul, ol, li

unordered and ordered lists are in fact not defined in the specification. "Lists may contain: Unordered information. Ordered information. Definitions."

p

The P element represents a paragraph

q

Q is intended for short quotations (inline content) that don't require paragraph breaks

samp

Designates sample output from programs, scripts, etc

strong

Indicates stronger emphasis

var

Indicates an instance of a variable or program argument


Attributes

alt
For user agents that cannot display images, forms, or applets, this attribute specifies alternate text
class
This attribute assigns a class name or set of class names to an element ... For general purpose processing by user agents
cite
The value of this attribute is a URI that designates a source document or message. This attribute is intended to point to information explaining why a document was changed.
cite
The value of this attribute is a URI that designates a source document or message. This attribute is intended to give information about the source from which the quotation was borrowed
datetime
The value of this attribute specifies the date and time when the change was made
id
The id attribute assigns a unique identifier to an element ... For general purpose processing by user agents
lang
This attribute specifies the base language of an element's attribute values and text content
longdesc
This attribute specifies a link to a long description of the image
rel
This attribute describes the relationship from the current document to the anchor specified by the href attribute
rev
This attribute is used to describe a reverse link from the anchor specified by the href attribute to the current document
title
This attribute offers advisory

information about the element for which it is set


January 8, 2007 | Permalink

TrackBack

TrackBack URL for this entry:
https://www.typepad.com/services/trackback/6a00d8341cbf7d53ef00e5503586418834

Listed below are links to weblogs that reference Built in Semantics in HTML:

Comments

"unordered and ordered lists are in fact not defined in the specification"

Hmm. By my reading, ordered lists are defined: An ordered list, created using the OL element, should contain information where order should be emphasized, as in a recipe; it's just unordered lists that aren't defined.

Posted by: Ben Buchanan | Jan 8, 2007 4:42:48 PM

How about the various elements that appear in head?
eg. title, meta, link & friends, as well as the profile attribute (and possibly xmlns?).

Also the hreflang attribute on a elements.

In certain circumstances I think br / can have semantic meaning as well (poems, etc. - probably a bit of contentious issue though).

Posted by: Lindsay Evans | Jan 8, 2007 5:03:22 PM

Ben,

what I meant was that the semantics of lists isn't defined. I mean, one the one hand, its pretty obvious what a list is. Yep, good point about ordered lists, I'll pay that - that quaifies as a definition :-) But a lot of it is pretty nebulous - p is a "paragraph" and so on.

thanks

j

Posted by: john Allsopp | Jan 8, 2007 7:04:27 PM

Lindsey,

I didn't mention it, but I also exclued head stuff - I think what I am specificaly interested in here is the semantics of visible HTML. But I'm not quite sure about that yet ;-)

In terms of br/, that's just too thorny - in a sense, there is an impled line element, but for poetry, it would probably make sense to have an explicit line element (even docbook isn't have this, afaik, which surprises me).

hreflang - I just thought it was too obscure and I got lazy - you are really on the ball there lindsey ;-)

thanks!

j

Posted by: john Allsopp | Jan 8, 2007 7:09:57 PM

HTML is very flexible. Great semantics.

Posted by: celebrity oops | Dec 12, 2009 8:35:46 PM

I think nowadays nobody using HTML, only PHP and AJAX

Posted by: drugs online | Aug 10, 2010 6:22:14 AM

nice post my friend

Posted by: brian adams | Nov 25, 2010 1:24:11 AM

HTML is very flexible. Great semantics...

Posted by: düzce haber | Dec 9, 2010 2:32:19 AM