首页 > 其他分享 >文本属性

文本属性

时间:2023-03-20 19:58:01浏览次数:34  
标签:定义 text align transform decoration 文本 文本属性

文本属性

 

text-align

指定元素文本的水平对齐方式

描述
left 文本居左排列,默认值
right 把文本排列到右边
center 把文本排列到中间
h1{text-align:center}
h2{text-align:left}
h3{text-align:right}

text-decoration

text-decoration属性规定添加到文本的修饰,下划线,上划线,删除线等.

描述
underline 定义下划线
overline 定义上划线
line-through 定义删除线
h1{text-decoration:overline}
h2{text-decoration:line-through}
h3{text-decoration:underline}

text-transform

text-transform属性控制文本的大小写

描述
captialize 定义每个单词开头大写
uppercase 定义全部大写字母
lowercase 定义全部小写字母
h1{text-transform:uppercase}
h2{text-transform:capitalize}
p{text-transtform:lowercase}

text-indent

text-indent属性规定文本块中首行文本的缩进

p{
   text-indent:50px;
}

温馨提示

负值是允许的.如果值是负数,将第一行左缩进

 

标签:定义,text,align,transform,decoration,文本,文本属性
From: https://www.cnblogs.com/andy-chi/p/17237494.html

相关文章