30

I have checkboxes like this:

<label class="checkbox-label"><input type="checkbox" value="115">Administrators</label>

But I cannot fugure out how to style the label to be center valigned to the checkbox.

I tried adding vertical-align:middle;

Thanks

user2043533
  • 731
  • 3
  • 9
  • 23
  • You'll probably need to use line-height or negative margins for your particular scenario. I'd provide an example, but you've given us no demo or CSS. – isherwood Mar 05 '13 at 18:02

3 Answers3

62

This is what I did with your code.

html

<label class="checkbox-label"><input type="checkbox" value="115">-middle</label>

css

label.checkbox-label input[type=checkbox]{
    position: relative;
    vertical-align: middle;
    bottom: 1px;
}

Fiddle

Artur K.
  • 3,263
  • 3
  • 38
  • 54
6

Try using:

vertical-align: text-bottom;

jsFiddle

Edit:

 <input id="checkbox" type="checkbox" value="115">
 <label class="checkbox-label" for="checkbox">Administrators</label>

jsFiddle

James Coyle
  • 9,922
  • 1
  • 40
  • 48
-3

Adjust the line height of the label.

Honorable Chow
  • 3,097
  • 3
  • 22
  • 22