且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在HTML中对齐文本框和文本/标签?

更新时间:1970-01-01 07:56:06

对于每个标签/输入对,有两个框,左边和右边。两个盒子在一行中并且具有固定的宽度。现在,您只需要使标签文本向右浮动, text-align:right;

You have two boxes, left and right, for each label/input pair. Both boxes are in one row and have fixed width. Now, you just have to make label text float to the right with text-align: right;

简单示例:

http://jsfiddle.net/qP46X /