W3C home > Mailing lists > Public > www-style@w3.org > October 2005

Re: Styling by attribute-based association?

From: Matthew Raymond <mattraymond@earthlink.net>
Date: Tue, 25 Oct 2005 17:28:17 -0400
Message-ID: <435EA371.7060907@earthlink.net>
To: Ian Hickson <ian@hixie.ch>
CC: David Hyatt <hyatt@apple.com>, W3C CSS <www-style@w3.org>

Ian Hickson wrote:
> On Tue, 25 Oct 2005, David Hyatt wrote:
>>Another (IMO simpler) idea would be to just have label match the same 
>>pseudo-classes that the control does, i.e., if a checkbox is :checked, 
>>then the label can match :checked too.  Same for :disabled, :enabled, 
>>:indeterminate, and :focus.  I don't see any reason to introduce new 
>>selectors to solve this problem.
> That doesn't address all of Matthew's requests, and would be specific to 
> <label>, not addressing similar problems with elements such as <map>, etc. 
> But I agree that it might make sense too.

   Another problem with David's idea is that it fails to address styling
based on attribute values rather than selectors. An example would be
specific labels for specific <input> types in HTML:

| label:friend(for, input[type=datetime])

   Then there's the associations to elements with specific classes or IDs:

| label:friend(for, .myClass)
| label:friend(for, #myID)

   Also, David's idea is misleading in some cases. As <label> has been
redefined in Web Forms 2.0, a label may not be able to have focus, for
instance. (Then again, it may be that we don't what this kind of styling
anyways, considering UI conventions. Yet, there again, if
non-conventional UI behavior is implemented, you'd significantly
complicate the method of styling that way.)
Received on Tuesday, 25 October 2005 21:28:02 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:21 UTC