右对齐输入字段 [英] right aligned input field
问题描述
我正在使用带有一堆输入标签的表单来输入数字。是否有任何
的方法来调整输入字段,以便数字对齐
右侧而不是左侧?即使是简单的html也不行,可以用java
脚本或其他东西帮助吗?
再见
Markus >
Markus Mueller写道:
我是使用带有一堆输入标签的表单输入数字。是否有任何
方法可以调整输入字段,以便数字在右侧而不是左侧对齐?即使是普通的html也不行,可以用java
脚本或其他东西帮忙吗?
试试CSS
< style type =" text / css">
@import url(styles.css);
< / style>
with the文件styles.css包含
input.rightAligned {
text-align:right;
}
然后
< input type =" text" class =" rightAligned">
-
Martin Honnen
http://JavaScript.FAQTs.com/
周二,18日2004年5月,Markus Mueller写道:
X-Newsreader:Microsoft Outlook Express 5.50.4927.1200
请访问< http:// piology .org / news / oe-erste-schritte.html>
我正在使用带有一堆输入标签的表单来输入数字。是否有任何
方法可以调整输入字段,以便数字在右侧而不是左侧对齐?
DIR =RTL
例如< http://www.google.co.il/>
-
Nicht的geht mehr ohne Apostroph。
Martin Honnen写道:
尝试CSS
< style type =" text / css">
@import url(styles.css);
< / style>
包含
文件styles.css input.rightAligned {
text-align:right;
}
然后
< input type =" text" class =" rightAligned">
是的,这通常会产生预期的效果。但是,值得提出的是,事实上,它不应该。根据CSS2
规范[1],/ text-align / property仅适用于块级
元素,其中/< input> /不是。我不知道CSS3将如何或者如果
解决这个问题。
[1] http://www.w3.org/TR/REC-CSS2/text.html#alignment-prop
问候,
-
NeyAndrédeMello Zunino
Hi,
I''m using a form with a bunch of input tags to enter numbers. Is there any
way to make the input field right adjusted, so that the numbers align at the
right side instead of the left? Even plain html doesn''t work, could java
script or something else help?
Bye
Markus
Markus Mueller wrote:
I''m using a form with a bunch of input tags to enter numbers. Is there any
way to make the input field right adjusted, so that the numbers align at the
right side instead of the left? Even plain html doesn''t work, could java
script or something else help?
Try CSS
<style type="text/css">
@import url(styles.css);
</style>
with the file styles.css containing
input.rightAligned {
text-align: right;
}
and then
<input type="text" class="rightAligned">
--
Martin Honnen
http://JavaScript.FAQTs.com/
On Tue, 18 May 2004, Markus Mueller wrote:
X-Newsreader: Microsoft Outlook Express 5.50.4927.1200
Please visit <http://piology.org/news/oe-erste-schritte.html>
I''m using a form with a bunch of input tags to enter numbers. Is there any
way to make the input field right adjusted, so that the numbers align at the
right side instead of the left?
DIR="RTL"
For example <http://www.google.co.il/>
--
Nicht''s geht mehr ohne Apostroph.
Martin Honnen wrote:
Try CSS
<style type="text/css">
@import url(styles.css);
</style>
with the file styles.css containing
input.rightAligned {
text-align: right;
}
and then
<input type="text" class="rightAligned">
True, that will often produce the desired effect. However, it is worth
mentioning that, in fact, it should not. According to the CSS2
Specification [1], the /text-align/ property applies only to block-level
elements, which /<input>/ is not. I do not know how or if CSS3 will
address this matter.
[1] http://www.w3.org/TR/REC-CSS2/text.html#alignment-prop
Regards,
--
Ney André de Mello Zunino
这篇关于右对齐输入字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!