Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个接受数值的文本框,当用户关注文本框或在其中键入任何内容时,我希望光标移动到右端。
HTML 标记
<input type="text" class="numericBox" tabindex="0" value="0.00">
CSS
.numericBox{ text-align:right; }
我已经尝试过direction:rtlCSS 的属性,但我认为它不一样。任何关于 jQuery 或纯 CSS/CSS3 的建议都将不胜感激。
direction:rtl
谢谢你。
您必须指定 dir 属性是 rtl
<input type="text" name="user" dir="rtl" />