2

I have a check box on a page:

as shown in this picture.

I would like the change the white background color to yellow, how can I do it?

Below is the HTML code of that checkbox.

<div class="checkbox">
<label>
   <input id="p-flag" type="checkbox" name="p_required" value="1"> Rrequired?
</label>
</div>

I tried

.checkbox{
            background-color: yellow;
}

But that's not working.

jcaron
  • 17,302
  • 6
  • 32
  • 46
user866933
  • 305
  • 1
  • 6
  • 16
  • Try this : https://jsfiddle.net/patelsumit5192/o9sooyra/ – Sumit patel Jul 22 '16 at 11:59
  • This has been answered before: http://stackoverflow.com/q/7398462/4699406 – Jan Jouke Tjalsma Jul 22 '16 at 12:00
  • No, it's not what i need. Just need to change the check box background color from white yo yellow. Not the background color of div. – user866933 Jul 22 '16 at 12:02
  • You can't. At least as far as my knowledge goes. If I find myself in this situation, I'll just create a checkbox myself, using div's and a custom (icon) font (or you can create one that looks like a radio button with just divs). That way, you can make it look exactly like you want it to. Then use jQuery to handle the ticks and all those things – Fred Jul 22 '16 at 12:06

0 Answers0