方向和文本对齐在css中的区别 [英] Differences between direction and text-align in css

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

问题描述

以下两者之间有什么区别:




  • direction:rtl


  • text-align:right




(与问题)

解决方案

方向从右向左排列您的元素。



示例:

  < div style =direction:rtl> 
< div style =display:inline-block> A< / div>
< div style =display:inline-block> B< / div>
< / div>

输出: BA



文本对齐在右侧显示您的元素。



示例:

 code>< div style =text-align:right; width:979px> 
test
< / div>

在指定宽度的最右边输出测试 >

What are the differences between:

  • direction : rtl

  • text-align: right

(Related to this question)

解决方案

Direction orders your element from right to left.

Example:

<div style="direction: rtl">
  <div style="display: inline-block">A</div>
  <div style="display: inline-block">B</div>
</div>

outputs: B A

Text-align display your element in the right.

Example:

<div style="text-align: right; width: 979px">
  test
</div>

outputs test on the rightmost edge of the specified width.

这篇关于方向和文本对齐在css中的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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