HTML and CSS Reference
In-Depth Information
rendering order and logical tab order. Because no one above
the level of WYSIWYG-wielding wannabe has used tables for
layout since Mozart went stegosaurus hunting, nowadays this
is not usually necessary. The default tab order is determined
by the order in which elements appear in your markup, so a
properly ordered and structured document should never require
additional tabbing hints.
However, tabindex does have a useful side effect. Normally, only
links, form elements, and image map areas can be focused via
the keyboard. Adding a tabindex can make other elements also
focusable, so executing a focus() command from JavaScript
would move the browser's focus to them. However, this would
also make these elements keyboard-focusable, which may not
be desirable.
Using a negative integer (by convention, tabindex=-1 ) allows the
element to be focused programmatically, “but should not allow
the element to be reached using sequential focus navigation.”
It's very useful in overcoming a bug in IE whereby, under some
circumstances, elements such as headings that were targets of
in-page links were never focused for screen reader users, leav-
ing the information inaccessible. (See www.juicystudio.com/
article/ie-keyboard-navigation.php for more information.) In
HTML 4, “-1” was an invalid value for the attribute, and the attri-
bute itself was invalid on any element other than form fields and
links. However, as it works in browsers now and it solves a real
problem, HTML5 legalises it everywhere. Yay!
Removed attributes
<table border=...>
Of course, there's no question that someone like you wouldn't
use tables to lay out a page, but just in case you are maintain-
ing or tweaking these old-school monsters, there are only two
allowed values for the border attribute: the empty string and
“1” . These simply give a hint to user agents that the table is for
layout. A better way to do this, however, is with the newfangled
ARIA role=presentation , which is interesting as its children don't
inherit it—so a table can be marked as presentational, but its
contents (a form inside one of the table cells, for instance) does
 
 
Search WWH ::




Custom Search