0

I'm getting trouble when i try to change the width of my input checkbox.

all inputs are width:200px (text, button, checkbox). But i need a width:20px only for checkbox.

Is it possible?

3 Answers 3

2

You can use:

input[type="checkbox"] {width:20px}

but this is not completely browser compatible. All browsers will recognise if you add a class to your checkboxes, ie.

<input type="checkbox" class="checkbox" />

then use:

.checkbox {width:20px}
Sign up to request clarification or add additional context in comments.

Comments

1
input[type=checkbox] { width: 20px; }

2 Comments

that is correct notation, but not works :) It will set width to 20px, but not visually. Try it, looks like added margins.
I paste it in my form.css file, but nothing happen
1

You can set via CSS smaller size than default for checkbox but not larger. If you want to increase size of checkbox, you'll need jquery. Example LINK

1 Comment

I will take a look, interesting custumized forms

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.