Table of Contents

Articles Posted During July 2002

nested_list

Here's a FAQ: Why won't my nested list validate? This one comes up surprisingly often in various Net fora.

If the W3C Validator gives you the following message:


  Error: element "li" not allowed here; possible cause 
  is an inline element containing a block-level element.

It's probably because the nested <ul> isn't contained within an <li>. Nested lists should be structured like this:


<ul>
  <li>1</li>
  <li>2
    <ul>
      <li>2.1</li>
      <li>2.2</li>
    </ul>
  </li>
  <li>3</li>
</ul>

2002-07-31 20:26:56

accesskey

It seems to me that the accesskey attribute is pretty much worthless without some kind of visual cue to let the user know which key is bound to a given element.

Fortunately, CSS2 inlcudes a mechanism by which authors can direct the user agent to generate content based on attribute values.

For example, including this rule will cause compliant browsers to render the character that will trigger the link directly after any A element that has an accesskey specified:


a[accesskey]:after {
    content:"[" attr(accesskey) "]";
}

Don't get too excited, though. It only works in Mozilla & Opera.

2002-07-30 23:36:44

label

Posted a javascript widget that adds proper support for the label element to Mozilla & its kin. Basically, it causes the browser to focus the associated form control when a label element receives focus.

2002-07-29 20:20:21