问题描述
我无法弄清楚。如何对齐文本框?我想使用float:左边的标签(然后做的输入,当我注意到输入现在在左边没有那个),但是是完全错误。
I cant figure it out. How do i align the textbox? I thought using float: left on the labels on the left (then doing it on the input when i notice the input was now on the left without that) but that was completely wrong.
如何使文本框与文本框左侧的标签(而不是最左边的文本框)对齐?
How do i get the textbox align along with the labels on the left of them next to the textbox instead of the far left?
图片是一个示例
推荐答案
对于每个标签/输入对,有两个框,左边和右边。两个盒子在一行中并且具有固定的宽度。现在,您只需要使标签文本向右浮动, 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;
简单示例:
这篇关于在HTML中对齐文本框和文本/标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!