Reputation: 183989
I'm trying to create the following CSS rules for my HTML form layouts:
|label | input |
Something I've noticed- Label widths don't seem to be able to be set by CSS?
Any good ideas? Thanks
Upvotes: 2
Views: 4800
Reputation: 17960
Your label needs to be floating:
label {
float: left;
width: 100px; /* change this to whatever you want */
/* these make it look nicer */
text-align: right;
padding-right: 10px;
}
You'll need something below it to clear the float as well, but this should do the trick.
Upvotes: 3