homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

LABEL background color not showing in I.E. 8/9?
Background color for div labels not showing when radio button checked

Msg#: 4555480 posted 10:57 pm on Mar 15, 2013 (gmt 0)

Hi all,

I'm trying to get the text next to a selected radio button to become "highlighted" with background color (once the radio button is selected). However, I'm not seeing the color highlight, only a faint dotted box around the text when selected. This is happening with I.E. 8 & 9.

HTML code:

<div class="hlText">
<label for="radio1"><input type="radio" id="radio1" name="something" value="1"> <span class="label">Some text here for Radio button #1</span></label>
<label for="radio2"><input type="radio" id="radio2" name="something" value="2"> <span class="label">Some text here for Radio button #1</span></label>

CSS code:

.hlText label {
display: block;

.hlText label {
margin-left: .1em;

.hlText input[type="radio"]:checked + .label {
border: #000000 1px solid;
background: #FFFF99;

Any ideas why the background color for the text isn't being highlighted when it's radio button is selected?



Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved