兼容各个浏览器的字体阴影的实现

来源:互联网 发布:传奇盛世翅膀数据7到8 编辑:程序博客网 时间:2024/05/17 18:13
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>字体阴影的实现</title>
<style type="text/css">
.font_shadow{
position:relative;
width:400px;
height:45px;
line-height:45px;
text-align:center;
font-size:36px;
color:#fff;
background:#9c0;
}
.font{
position:absolute;
left:-2px;
top:-2px;
color:#444;
width:400px;
height:45px;
display:block
}
</style>
</head>
<body>
 <div class="font_shadow" >这是描边文字
  <span class="font">这是描边文字</span>
 </div>
</body>
</html>