[whatwg] required attribute in label

2010-08-21 Thread WhatWg
This question is sort of CSS related, but I think it's worth bringing up here, assuming it hasn't already been discussed. The first thing I wanted to do with the required attribute when I started playing with it is to use the CSS :after pseudo-element to add an asterisk after every required

Re: [whatwg] required attribute in label

2010-08-21 Thread Chris Cressman
Why not make required an acceptable attribute for the label element? The class or title attribute can solve your problem: label class=required label.required:after {content:*} label title=required label[title~=required]:after {content:*}

Re: [whatwg] required attribute in label

2010-08-21 Thread Diego Perini
This could be another way to solve the same problem: style label + input[required] + span:after { content: * ; } /style label for=name1Name/label input id=name1 type=text requiredspannbsp;/span However, the above does not work on IE6 (attribute selectors). So the id/class suggested by Chris is

Re: [whatwg] required attribute in label

2010-08-21 Thread Tab Atkins Jr.
On Fri, Aug 20, 2010 at 11:33 PM, WhatWg wha...@gmail.com wrote: However, it seems that since input is an empty element, the content cannot be added after. Right; inputs don't have children. (In some actual implementations, they just automatically hide their children from the rest of the DOM.)

Re: [whatwg] required attribute in label

2010-08-21 Thread Brenton Strine
label class=required and input id=name1 type=text requiredspannbsp;/span are effective, but then again this would be too: .../label* It just seems a shame that we have this neat attribute that indicates required controls, but we can't actually use it to change the presentation adding

Re: [whatwg] required attribute in label

2010-08-21 Thread Eduard Pascual
On Sat, Aug 21, 2010 at 6:18 PM, Brenton Strine wha...@gmail.com wrote: label class=required and input id=name1 type=text requiredspannbsp;/span are effective, but then again this would be too: .../label* It just seems a shame that we have this neat attribute that indicates required