The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "SVG" Oct 14 - 6:30 PM Eastern
Get a free trial // Grow your CSS skills // Land your dream job

Change color of a Label

  • # September 28, 2009 at 1:47 pm


    How can i change the background color of a label when the input is selected. The label in question is for a serie of radio input.

    Thanks a lot for any suggestion

    # September 29, 2009 at 5:32 am

    onClick="if (this.checked){uno.className=’item1′}else{uno.className=’choise’}" :D

    # October 7, 2009 at 11:20 pm

    If you’re using jQuery it’s really easy.

    $(‘input’).focus(function() {
    $(this).prev(‘label’).css(‘color’, ‘green’);
    }).blur(function() {
    $(this).prev(‘label’).css(‘color’, ‘blue’);
    # October 9, 2009 at 1:51 am

    I can’t see the option to change my labels,i’m iu suppose to enable something in order to change the label color.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed