CSS Checkbox formatting

Soldato
Joined
28 Sep 2008
Posts
14,218
Location
Britain
Hi guys,

My CSS does some general form formatting, but when I use a checkbox, it applies the border around it (even if I specift border: 0px;). I just want the checkbox on it's own.

What do I need to add?

Code:
/* General form settings */
form
{
margin:0;
}
form p
{
clear:left;
margin:2px 0;
}
form span.warning
{
margin-left:0.25em;
color: #ff0000;
}
fieldset
{
margin:10px;
border:1px solid #d9d9d9;
padding-bottom:10px;
}
legend
{
margin:0 0 0.5em 0;
padding:0.25em 0.5em;
background-color: #404040;
color:#fff;
font-size:1em;
font-weight:700;
}
label
{
float:left;
width:220px;
margin:2px 0;
font-weight:700;
color: #404040;
vertical-align:middle;
}
input, textarea
{
float:left;
margin:2px 0;
border:1px solid #d9d9d9;
font-family:Arial,Geneva,Helvetica,sans-serif;
font-size:1em;
color:#333;
background-color:#fff;
}
#checkbox
{
width:100%
border: 0px;
}
input
{
width:20em;
}
select
{
float:left;
margin:2px 0;
}
input.button
{
float:none;
width:10em;
padding:0px 7px 0px 7px;
background-color:#d9d9d9;
color:#000;
line-height:normal !important;
text-align:center;
font-weight:700;
}
 
Border: 0px is fine - it uses the shorthand property for border.

The problem - and you'll want to kick yourself - no semi-colon after width: 100% in the #checkbox rule :D

Are you testing something - as having a checkbox which is 100% width is a little odd?

FffffffffffffffffffuuuuuuuUUUUUUUUUUUUUUUUUUUUUUUU

Thanks
 
Ok, now the formatting is fubar'd. How do I get the checkboxes to align to the left in line with the other boxes?

At the mo I have this:

123ndr.jpg


I've tried, align: left; and vertical-align and float, etc
 
No, i've ditched that. I tried the negative margin but it made some of the text to the left disappear

Just an FYI, I've removed the border attribute so you can see what the positioning is doing. It seems to be picking up the text area. Basically, I want that box all the way over to the left of the border without the border moving (which is what would happen if I put in a negative px width)

123ci.jpg
 
Last edited:
Back
Top Bottom