We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
其实很简单:
.input { text-align: right }
需要分清和direction: rtl;的区别
direction: rtl;
text-align是让文本靠右,而direction: rtl;是改变文本的方向
text-align
<style type="text/css"> div.one { text-align: right } div.two { direction: rtl; } </style> <div class="one">Some text. Right-to-left direction.</div> <div class="two">Some text. Left-to-right direction.</div>
.class的显示效果只是让文字整体平移到右边 .two除了文字移到了右侧显示,文字也发生了改变。 会先成:.Some text. Left-to-right direction,看见区别了吗?句号位置变了。
.class
.two
.Some text. Left-to-right direction
经过我的测试,如果只是改变文本内容,direction: rtl;会改变符号和文字的位置,而文字如果也想从右往左写,只需要稍加改动,就可以把顺序完全颠倒,变成从右往左写:
div.two { direction: rtl; unicode-bidi:bidi-override; }
就会变成: Some text. Left-to-right direction.
Some text. Left-to-right direction.
但是,如果换成是input,除了显示跟本文的显示方式一样以为,光标是不一样的。 direction: rtl; 因为是改文字方向,所以光标也改成了在左边。使用backspace和delete按键也会相反。 text-align: right是改变了文字的位置,而不是方向,光标是正常的,所以这个才是我们需要用的属性。
backspace
delete
text-align: right
The text was updated successfully, but these errors were encountered:
No branches or pull requests
其实很简单:
需要分清和
direction: rtl;
的区别text-align
是让文本靠右,而direction: rtl;
是改变文本的方向.class
的显示效果只是让文字整体平移到右边.two
除了文字移到了右侧显示,文字也发生了改变。 会先成:.Some text. Left-to-right direction
,看见区别了吗?句号位置变了。经过我的测试,如果只是改变文本内容,
direction: rtl;
会改变符号和文字的位置,而文字如果也想从右往左写,只需要稍加改动,就可以把顺序完全颠倒,变成从右往左写:就会变成:
Some text. Left-to-right direction.
但是,如果换成是input,除了显示跟本文的显示方式一样以为,光标是不一样的。
direction: rtl;
因为是改文字方向,所以光标也改成了在左边。使用backspace
和delete
按键也会相反。text-align: right
是改变了文字的位置,而不是方向,光标是正常的,所以这个才是我们需要用的属性。The text was updated successfully, but these errors were encountered: