郑重声明,如果引用,请注明出处:(原创 博客园:天之子)
CSS3 应用01 - 文本阴影效果(兼容IE 7-9 Firefox Opera Chrome 等多浏览器)介绍了文本阴影的简单应用。
下面,常见的文本特效:嵌入字、立体字、霓虹灯等文本效果,提供完整的 CSS 代码。
1、嵌入字


<!
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=utf-8" />
< title ></ title >
< style type ="text/css" >
body
{
background-color : #535353 ;
}
h1
{
color : #353535 ;
font-family : 微软雅黑 ;
font-size : 48pt ;
font-weight : bold ;
text-shadow : 0px -2px 0px #0D0D0D, 0px 2px 3px #666666 ;
}
</ style >
</ head >
< body >
< div >
< h1 >
< span > 基本业务框架系统 </ span >
</ h1 >
</ div >
</ body >
</ html >
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" />
< title ></ title >
< style type ="text/css" >
body
{
background-color : #535353 ;
}
h1
{
color : #353535 ;
font-family : 微软雅黑 ;
font-size : 48pt ;
font-weight : bold ;
text-shadow : 0px -2px 0px #0D0D0D, 0px 2px 3px #666666 ;
}
</ style >
</ head >
< body >
< div >
< h1 >
< span > 基本业务框架系统 </ span >
</ h1 >
</ div >
</ body >
</ html >
2、立体字


<!
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=utf-8" />
< title ></ title >
< style type ="text/css" >
body
{
background-color : #535353 ;
}
h1
{
color : #00f ;
font-family : 微软雅黑 ;
font-size : 48pt ;
font-weight : bold ;
text-shadow : 1px 1px 0 #ccc, 2px 2px 0 #bbb, 3px 3px 0 #aaa, 4px 4px 0 #999, 5px 5px 0 #666, 6px 6px 1px #000, 0 0px 3px #000, 0 1px 3px #000, 0 3px 5px #000, 0 5px 10px #000, 0 5px 20px #000 ;
}
</ style >
</ head >
< body >
< div >
< h1 >
< span > 基本业务框架系统 </ span >
</ h1 >
</ div >
</ body >
</ html >
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" />
< title ></ title >
< style type ="text/css" >
body
{
background-color : #535353 ;
}
h1
{
color : #00f ;
font-family : 微软雅黑 ;
font-size : 48pt ;
font-weight : bold ;
text-shadow : 1px 1px 0 #ccc, 2px 2px 0 #bbb, 3px 3px 0 #aaa, 4px 4px 0 #999, 5px 5px 0 #666, 6px 6px 1px #000, 0 0px 3px #000, 0 1px 3px #000, 0 3px 5px #000, 0 5px 10px #000, 0 5px 20px #000 ;
}
</ style >
</ head >
< body >
< div >
< h1 >
< span > 基本业务框架系统 </ span >
</ h1 >
</ div >
</ body >
</ html >
3、霓虹灯


<!
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=utf-8" />
< title ></ title >
< style type ="text/css" >
body
{
background-color : #535353 ;
}
h1
{
color : #00f ;
font-family : 微软雅黑 ;
font-size : 48pt ;
font-weight : bold ;
text-shadow : 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff, 0 0 40px #00ff11, 0 0 70px #00ff11, 0 0 80px #00ff11, 0 0 100px #00ff11, 0 0 150px #00ff11 ;
}
</ style >
</ head >
< body >
< div >
< h1 >
< span > 基本业务框架系统 </ span >
</ h1 >
</ div >
</ body >
</ html >
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv ="Content-Type" content ="text/html; charset=utf-8" />
< title ></ title >
< style type ="text/css" >
body
{
background-color : #535353 ;
}
h1
{
color : #00f ;
font-family : 微软雅黑 ;
font-size : 48pt ;
font-weight : bold ;
text-shadow : 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff, 0 0 40px #00ff11, 0 0 70px #00ff11, 0 0 80px #00ff11, 0 0 100px #00ff11, 0 0 150px #00ff11 ;
}
</ style >
</ head >
< body >
< div >
< h1 >
< span > 基本业务框架系统 </ span >
</ h1 >
</ div >
</ body >
</ html >
如果要问 IE 系列浏览器怎么办?对不起,凉拌!
微软的 IE 浏览器真的是万恶之源,尤其是政府机关还在用 IE 6,已经严重影响了程序员的发展,历史的车轮在滚滚前进,我们的程序员的脚步却在这种无奈中:停留太久,太久。。。还将继续下去啊。。。
顺便说一句:博客园的插入代码真的很垃圾,还是我不会用?只有一个“显示代码”选项+显示行号,至少也得有个显示纯文本、打印之类的吧?
有的读者提出去掉行号,以后我的代码尽量不添加行号,方便复制粘贴使用。谢谢关注!