W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2005

[whatwg] [WA1] <sl> - The Selection List element

From: Matthew Raymond <mattraymond@earthlink.net>
Date: Thu, 02 Jun 2005 11:20:24 -0400
Message-ID: <429F23B8.3090307@earthlink.net>
R.J.Koppes wrote:
> I don't really see the advantage above using ordinary lists or form controls
> and css pseudoclasses like :target ,:focus and :active

    Let's look at these pseudoclasses one at a time...

    The :target pseudoclass only applies to an element that has its |id| 
attribute as part of the URL. If it isn't in the URL, or the URL changes 
so that the |id| is no longer in the URL, then the styling is not applied.

    Focus is lost when you click on something else on the page, so you 
can't use :focus to style a list item as being a selected tab.

 From the CSS3 Selectors spec:
| The :active pseudo-class applies while an element is being activated
| by the user. For example, between the times the user presses the mouse
| button and releases it.

    So clearly :active is useless once your mouse button is up.

    The only real way to use a list for tabs without Javascript is to 
have a list that maintains items as being selected. So, we either 
provide a way to do that with current lists, or create a new list. If 
you can think of a way that existing lists can be given a means of item 
selection, then that's fine as well. Here's a thought on that:

| <ul selection="single">
|   <li selected="selected"><a href="#s1">Section 1</a></li>
|   <li><a href="#s2">Section 2</a></li>
|   <li><a href="#s3">Section 3</a></li>
| </ul>
Received on Thursday, 2 June 2005 08:20:24 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:41 UTC