29

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
  • 719
  • 3
  • 9
  • 21
  • 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

59

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.
  • 2,970
  • 3
  • 35
  • 50
5

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
  • 8,191
  • 1
  • 32
  • 46
-2

Adjust the line height of the label.

Honorable Chow
  • 2,783
  • 2
  • 19
  • 22