Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS :checked psuedo class for an li

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #265588
    cives
    Participant

    Hi all – I’m currently using .inputs-list li {} as a selector to apply some styling to buttons. However, when the button is selected (in the form of radio buttons). I would like to apply a new set of styling to the buttons. I’m currently using:

    #single-cap-form input[type=”radio”]:checked + .inputs-list li{
    background:white !important;
    }

    Is this the proper way to mark this up? I was able to follow this structure to change the color of a selected span tag with:

    #single-cap-form input[type=”radio”]:checked + span{
    color:black !important;
    }

    But this is not working when changing the background color. Any ideas? I assume I just have the order wrong.

    Thanks

    #265618
    Beverleyh
    Participant

    Unfortunately we can’t comment without seeing the HTML too. A CodePen demo would be the most useful thing for us to determine what it is you’re doing.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.