CSS3 -- API学习 (文本效果)

  • text-shadow      文本阴影
  • text-overflow     文本溢出
  • word-wrap        文本换行
  • word-break       文本分词

1.text-shadow

与box-shadow不同的是,没有盒子边框宽度设置

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
<style>
h1
{
    text-shadow: 5px 5px 5px #FF0000;
}
</style>
</head>
<body>
<h1>Text-shadow effect!</h1>
<p><b>注意:</b> Internet Explorer 9 以及更早版本的浏览器不支持 text-shadow属性.</p>
</body>
</html>

 

 

 

 

 

 

 

 

 

 

结果:

CSS3 -- API学习 (文本效果)

2.text-overflow

CSS3 -- API学习 (文本效果)

3.word-wrap

p {word-wrap:break-word;}   整词换行

CSS3 -- API学习 (文本效果)

4.word-break 

CSS3 -- API学习 (文本效果)