CSS text-align 属性

实例

h1, h2, 和 h3元素设置文本的对齐方式:

h1 {text-align:center} h2 {text-align:left} h3 {text-align:right}


尝试一下 »

在此页底部有更多的例子。


属性定义及使用说明

text-align属性指定元素文本的水平对齐方式。

默认值: 如果 direction 属性是 ltr,则默认值为 left;如果 direction 属性是 rtl,则默认值为 right。
继承: yes
版本: CSS1
JavaScript 语法: object.style.textAlign="right"


浏览器支持

表格中的数字表示支持该属性的第一个浏览器版本号。

紧跟在 -webkit-, -ms- 或 -moz- 前的数字为支持该前缀属性的第一个浏览器版本号。

属性
text-align 1.0 3.0 1.0 1.0 3.5

属性值

猜你喜欢

转载自blog.csdn.net/shengyin714959/article/details/132962487