CSS text-属性汇总

 

1.text-shadow 属性

text-shadow: 5px 5px 5px #FF0000;

CSS text-属性汇总_第1张图片 

CSS text-属性汇总_第2张图片

 

2.text-overflow 属性 (string)

text-overflow:ellipsis;

CSS text-属性汇总_第3张图片 

CSS text-属性汇总_第4张图片

string:用自定义字符串来代表被修剪的文本(目前只在Firefox 浏览器下有效,style="text-overflow:'****';")

使用text-overflow:ellipsis时要注意一下两点: 
1.overflow: hidden; text-overflow:ellipsis;white-space:nowrap;这三个一定要一起用,如果少了white-space:nowrap,文字会把撑高容器的高度,导致替换字符显示不出来;如果少了overflow: hidden,文字会横向撑到容器的外面; 
2.一定要给容器定义宽度。

 

3.text-align 属性

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

CSS text-属性汇总_第5张图片

注释:

1.水平对齐属性justify,它会带来自己的一些问题。

2.任何的版本的 Internet Explorer (包括 IE8)都不支持属性值 "inherit"。

4.text-decoration 属性

h1 {text-decoration:overline}
h2 {text-decoration:line-through}
h3 {text-decoration:underline}

CSS text-属性汇总_第6张图片

 

 

 

 

 

 

 

你可能感兴趣的:(#,CSS3,+,HTML5系列)