1 Replies - 394 Views - Last Post: 05 October 2012 - 09:21 AM

#1 chrisp200  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 82
  • Joined: 18-November 08

Is this possible in CSS?

Posted 05 October 2012 - 08:34 AM

I am not sure if this possible in CSS, but is there anyway to style the label if its radio button is active?

http://jsfiddle.net/ASmsX/


If its not possible in CSS, why?
Is This A Good Question/Topic? 0
  • +

Replies To: Is this possible in CSS?

#2 NathanMullenax  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 83
  • View blog
  • Posts: 176
  • Joined: 23-September 12

Re: Is this possible in CSS?

Posted 05 October 2012 - 09:21 AM

Hello: I can't really take credit for this one, but I found this on SO:

http://stackoverflow...o-buttons-label

Basically it boils down to a rule like this:

input[type=radio]:checked+label
{
    background-color: blue;
}



Where the '+ label' means a label after an element that matches the preceding expression.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1