CSS3 的text-shadow实现立体文字和燃烧文字

来源:互联网 发布:中原工学院软件怎么样? 编辑:程序博客网 时间:2024/05/15 09:53

立体文字演示效果如下:


代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
     p{
      text-align: center;
      background: #CCC;
      font-size: 40px;
      font-weight: bold;
      color: #D1D1D1;
      text-shadow: -2px -2px white,
                  2px 2px #333;
     }
</style>
</head>
<body>
<p>html5 + css3</p>
</body>
</html>


燃烧效果如下:


代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
    body{
        background: #000;
    }
     p{
      text-align: center;
      font-size: 40px;
      font-weight: bold;
      color: red;
      text-shadow: 0 0  4px white,
                    0 -5px 4px #ff3,
                    2px -10px 6px #fd6,
                    -2px -15px 11px #f80,
                    2px -25px 18px #f20;
     }
</style>
</head>
<body>
<p>html5 + css3</p>
</body>
</html>

0 0