noclist
noclist

Reputation: 1819

Trouble lining up form elements using a label width

I'm trying to vertically align all my input elements using a fixed width on my labels, but not getting the result I'm expecting.

    label {
    width: 75px;
    }

Here is a Fiddle I've created with an example:

http://jsfiddle.net/xRmHj/

Any suggestions?

Upvotes: 0

Views: 301

Answers (2)

freshbm
freshbm

Reputation: 5632

Try with:

display:inline-block;

on your labels.

http://jsfiddle.net/xRmHj/1/

Upvotes: 2

Miljan Puzović
Miljan Puzović

Reputation: 5820

label {
   width: 75px;
   display: inline-block;
}

http://jsfiddle.net/xRmHj/2/

Upvotes: 2

Related Questions