How to align all fields as label width grows

后端 未结 5 2505
暖寄归人
暖寄归人 2021-02-20 18:05

I have a form where the labels are on the left and the fields on the right. This layout works great when the labels have small amounts of text. I can easily set a min-widt

5条回答
  •  悲哀的现实
    2021-02-20 18:19

    I think this is what you're looking for:

    label
    {
        width: 150px;
        display: inline-block;
    }
    input[type=text]
    {
        display: inline-block;
    }
    

    http://jsfiddle.net/rQ99r/5/

提交回复
热议问题