Class 2 – Special vs. Arbitrary XHTML Attributes
Posted: October 8th, 2010 | Author: amos | Filed under: xhtml | Tags: attributes, class 2 | No Comments »One of the confusing things about XHTML is that some attributes of HTML tags have special meaning and, while other attributes do not. So it’s hard to know whether an attribute value can be free-form and arbitrary, of your own choosing, or whether it has to have a specific predetermined value in order to function properly within the browser.
Some common attributes that always have arbitrary values of your own choosing are:
- id
- class
- name
- value
- for
- title
- alt
- href – must be a URI
- src – must be a URI
- action – must be a URI
Other attributes that always have special meaning and must have a specific value in order to function properly are:
- selected – has only one meaningful value, “selected”
- checked – has only one meaningful value, “checked”
- type
- rel
It is important that you become familiar looking up what each of these attributes does for various XHTML elements on w3schools.com’s XHTML tag reference page, which is intentionally not linked from here. You should know where to find it.
Related posts:
- Class 2 – XHTML Syntax
- Class 2 – Common XHTML Elements
- Class 2 – The Bare Minimum Elements of an XHTML Page
- Class 2 – Usage of the Most Common XHTML Elements
Leave a Reply