在HTML中对齐文本框和文本/标签? [英] align textbox and text/labels in html?

查看:616
本文介绍了在HTML中对齐文本框和文本/标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法弄清楚。如何对齐文本框?我想使用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;

简单示例:

http://jsfiddle.net/qP46X /

这篇关于在HTML中对齐文本框和文本/标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆