CSS3 应用02 - 嵌入字+立体字+霓虹灯 等文本效果

本文介绍如何使用CSS3实现嵌入字、立体字及霓虹灯等文本特效,并提供了完整的代码示例。

郑重声明,如果引用,请注明出处:(原创 博客园:天之子

CSS3 应用01 - 文本阴影效果(兼容IE 7-9 Firefox Opera Chrome 等多浏览器)介绍了文本阴影的简单应用。

下面,常见的文本特效:嵌入字、立体字、霓虹灯等文本效果,提供完整的 CSS 代码。

1、嵌入字

ContractedBlock.gif ExpandedBlockStart.gif 显示代码

   
<! 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 >

2、立体字

ContractedBlock.gif ExpandedBlockStart.gif 显示代码

   
<! 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 >

3、霓虹灯

ContractedBlock.gif ExpandedBlockStart.gif 显示代码

   
<! 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 >
以上代码支持 Firefox、Chrome、Opera 等 CSS3 的浏览器,不支持 IE 系列浏览器。

如果要问 IE 系列浏览器怎么办?对不起,凉拌!

微软的 IE 浏览器真的是万恶之源,尤其是政府机关还在用 IE 6,已经严重影响了程序员的发展,历史的车轮在滚滚前进,我们的程序员的脚步却在这种无奈中:停留太久,太久。。。还将继续下去啊。。。

顺便说一句:博客园的插入代码真的很垃圾,还是我不会用?只有一个“显示代码”选项+显示行号,至少也得有个显示纯文本、打印之类的吧?

有的读者提出去掉行号,以后我的代码尽量不添加行号,方便复制粘贴使用。谢谢关注!

转载于:https://www.cnblogs.com/flyboy4u/archive/2011/06/22/2087074.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值