Forum Moderators: not2easy

Message Too Old, No Replies

CSS to remove shading on a checkbox?

         

kapow

3:21 pm on Oct 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can css remove the default shading on a checkbox?

I have added a border to checkboxes on my form, they would look better if I could remove the default shading e.g. set it to white or none.

Geoffrey james

9:19 pm on Oct 18, 2006 (gmt 0)

10+ Year Member



can you add a class to checkboxes, never tried it but you can to form feilds and tectareas which i have just done for 1 site.

try this with css.

.checkbox {
background-color: white;
border: 1px solid black;
}

and give the checkbox that class

ie:

<input type="checkbox" class="checkbox" value="whatever">

not sure if it will work but worth a go.

geoff

swa66

10:32 pm on Oct 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



input[type=button] {
border: 1px solid black;
}

should do the trick (you'll need a dedicated class for MSIE6 (7?) as it doesn't do the attribute sector)

I'm pretty sure safari will ignore some of this and override it with it's look and feel.

kapow

6:51 am on Oct 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The border works but that is not the problem. The problem is removing the default 3D shade effect from checkboxes. Neither of the above solutions do this in IE.

Is this something that can't be done?

DrDoc

7:57 am on Oct 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Correct, IE won't let you style various aspects of several form elements. It's perhaps best not to attempt styling them at all in order to preserve a look and feel your visitors are used to.