Anda di halaman 1dari 2

The start and value attributes

The start attribute lets us set the ordered lists first counter, handy for splitting a list over several elements, but continuing the second lists numbering from where the previous list left off. The related value attribute lets us set an s value, allowing us to manually number one or more list items. The following code shows how to use start or value to continue a list and also demonstrates type: <!-- Continuing a previous list with value="" --> <ol type="I"> <li value="7">seventh item</li> <li>eighth item</li> <li>ninth item</li> </ol> <!-- Continuing a previous list with start="" --> <ol type="I" start="7"> <li>seventh item</li> <li>eighth item</li> <li>ninth item</li> </ol> While these are handy additions to our HTML toolbox, adding or removing list items can make the numbering appear broken. For this reason, you will probably want to investigate CSS-generated content counters instead; read Automatic numbering with CSS Counters by David Storey ( 16). Youll also need them for nested list counters like 1.2.1.

The reversed attribute


is completely new and allows us to create descending lists, which are very handy for top ten lists and rocket launches. While browser support for reversed is nascent at the time of writing, we can always fake it using value, which, like the other HTML 3.2 attributes, is still supported by all browsers. This is handy as we can use Modernizr together with a JavaScript polyfill to easily add support (for the definition of polyfill, see Chapter 2). For more information on this (and on all of these attributes), refer to our more detailed article The ol Element and Related Attributes: type, start, value, and reversed ( 17).

The <dl> element

In HTML 4, was for definition lists and was the topic of some heated debate amongst standardistas. Depending on whom you talked to, it was either solely for dictionary-style definitions or potentially a container suitable for all sorts of content: conversations, addresses, you name it. HTML 4s somewhat loose description and unusual examples didnt help. In HTML5, things have become a lot clearer. The biggest change is its now a description list for name- value pairs.

The dl element represents an association list consisting of zero or more name- value groups (a description list). ... Name-value groups may be terms and definitions, metadata topics and values, questions and answers, or any other groups of name-value data. HTML Living Standard, WHATWG (18)
Our new description list still uses good old for names and for values, and we can still have multiples of each (hence "groups"). One new caveat is that a name may only be used once per ,

Anda mungkin juga menyukai