format checkbox input

I have a list of checkboxes that works fine. The label text can be handeled by a style

I just cant set a background or any properties of the checkbox

<form method="post" name="forma" action="modex.php" >

<div style="height: 6em; width: 12em; overflow: auto;">

<input  type="checkbox" id="armadora" name="armadora[]" value="AUDI"  onclick="changeFunc('AUDI');">
<label style="background-color: #EAF5FE; font-family:Arial;" for="AUDI">AUDI</label>

<input  type="checkbox" id="armadora" name="armadora[]" value="BENTLEY"  onclick="changeFunc('BENTLEY');">
<label style="background-color: #EAF5FE; font-family:Arial;" for="BENTLEY">BENTLEY</label>

<input  type="checkbox" id="armadora" name="armadora[]" value="BMW"  onclick="changeFunc('BMW');">
<label style="background-color: #EAF5FE; font-family:Arial;" for="BMW">BMW</label>
<input type="submit">

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Not really possible, the checkbox is one of those elements that cannot be styled - you have to replace it with a different element and bind the two together

If you are using jQuery there's a rake of plugins you can use
robrodpAuthor Commented:
Mh... well I changed to checkboxes because jquery is not working with ie 11 And as yoy commented, I thought I could format it anyway I needed. I guess I got theat wrong
jquery is not working with ie 11
Would be easier to just use a list tag.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

robrodpAuthor Commented:
Definitely a list tag is the way to go

Kyle HamiltonData ScientistCommented:
if you are not concerned with IE 8 or below, you can use the :checked pseudo class to "style" the check boxes. Essentially, you will be hiding the checkbox and replacing it with an image. By styling the label element all the functionality of the checkbox will remain intact.

In this example, I am using modernizr to test for support of the :checked pseudo class. This is optional. But remember to remove the ".csschecked" qualifier if you remove the modernizr code. And of course, provide your own check graphic.

You do not need jquery for this one, but like Gary pointed out, why your jquery isn't working in IE 11 is questionable.

<!doctype html>
		<meta charset="UTF-8">

        <meta name="viewport" content="width=device-width, initial-scale=1" /> 
        <meta name="apple-mobile-web-app-capable" content="yes" /> 
        <meta name="apple-mobile-web-app-status-bar-style" content="black" /> 
        <link rel="apple-touch-startup-image" href="/startup.png">

        <meta name="description" content="Graphic design and web development">
        <meta name="author" content="C &amp; P Generation, LLC">
			.csschecked .single-checkbox{

			.csschecked .single-checkbox input{
			    filter: alpha(opacity = 0);
			.csschecked .single-checkbox label{
			    padding-top: 2px;
			    background:url( 0 0 no-repeat;
			.csschecked .single-checkbox :checked + label{
			    background-position:0 -30px;

		<script src=""></script>
		Modernizr.addTest('csschecked', function () {
				  return Modernizr.testStyles("#modernizr input {margin-left:0px;} #modernizr input:checked {margin-left: 20px;}", function (elem) {
				    var chx = document.createElement('input');
				    chx.type = "checkbox";
				    chx.checked = "checked";
				    return elem.lastChild.offsetLeft >= 20;
		<div class="wrapper">
			<div class="single-checkbox">
			    <input type="checkbox" id="chk1"> 
			    <label for="chk1">Check it!</label>
		<script src=""></script>

Open in new window

robrodpAuthor Commented:
jquery gives me starnge resulras it is too browser dependent.

Id rather use checkboxes ia a more traditional way so I have no problems with my users.

And in México I am definitely concerned with ie 8 and lower
Kyle HamiltonData ScientistCommented:
jquery is not browser dependent. if you are running into issues in ie 11 it's or some other reason.

If you want to use traditional checkboxes in IE less than 8 then you will not be able to style them, and to try to hack something together for some ancient and inferior browser would not be wise. Let the check boxes fall back to their default look and feel in those browsers.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.