<!doctype html><body><head><title>文本属性</title><metacharset="utf"><styletype="text/css">div{
width:400px;
height:500px;
background:red;
}p{
font-size:20px;
}.p1{
word-spacing:20px;
}.p2{
word-spacing:40px;
}.p3{
word-spacing:60px;
}</style></head><body><div><pclass="p1">I am bree good good study day day up</p><hr/><pclass="p2">I am bree good good study day day up</p><hr/><pclass="p3">I am bree good good study day day up</p><hr/></div></body></body>
显示结果
direction文本方向
属性值
ltr:从左到右
rtl:从右到左
inherit:继承
代码
<!doctype html><body><head><title>文本属性</title><metacharset="utf"><styletype="text/css">div{
width:800px;
height:500px;
background:red;
}p{
font-size:20px;
}.p1{
}.p2{
direction:rtl;
}.p3{
direction:ltr;
}</style></head><body><div><pclass="p1">I am bree good good study day day up</p><hr/><pclass="p2">I am bree good good study day day up</p><hr/><pclass="p3">I am bree good good study day day up</p><hr/></div></body></body>
显示结果
text-transform文本大小写
属性
none:默认
capitalize:每个单词以大写字母开头
uppercase:定义只有大写字母
lowercase:仅有小写字母
inherit:规定应该从父元素继承text-transform属性的值
代码
<!doctype html><body><head><title>文本属性</title><metacharset="utf"><styletype="text/css">div{
width:800px;
height:500px;
background:red;
}p{
font-size:20px;
}.p1{
text-transform:capitalize;
}.p2{
text-transform:uppercase;
}.p3{
text-transform:lowercase;
}</style></head><body><div><pclass="p1">I am bree good good study day day up text-transform:capitalize</p><hr/><pclass="p2">I am bree good good study day day up text-transform:uppercase;</p><hr/><pclass="p3">I am bree good good study day day up text-transform:uppercase;</p><hr/></div></body></body>