TedSquee
TedSquee

Reputation: 49

Radio Buttons - styling background onclick

I have been trying to get this working for a while and it's not happening for me. I want to style the background label of a radio button onclick.

Pretty much change the background of the label to full opacity (white) with a border-left: 13px solid #000;

Does anyone have any ideas of how to do this? http://www.testmethanks.com/test/index.html

Upvotes: 1

Views: 861

Answers (1)

Sanova
Sanova

Reputation: 541

Here you go: http://jsfiddle.net/peSJG/42/

.radiostyle {
    background-color: #999;
}
input[type=radio]:checked+label {
    background-color: white;
    border-left: 13px solid #000;
}


<input type="radio" name="1" value="100" id="a1">
<label for="a1" class="radiostyle">Click to make label BG whie, and add a 13px left side border</label>

No JS, all CSS.

Upvotes: 1

Related Questions