css实现文字描边\边框

转自:http://bbs.blueidea.com/thread-2420331-1-1.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><title>Cross-Browser Text Glow Demo</title>
<style type="text/css">
* {
font-family:Arial,Helvetica,sans-serif;
font-size:16px;
}
div {
	position:absolute;
	top:20px;
	left:20px;
	padding:0;
	color:#000;
	z-index:3;
}
#d2, #d3, #d4, #d5, #d6, #d7 {color:#fd6;}
#d8, #d9, #d10, #d11, #d12, #d13 {color:#ffa;}
.top {color:#fff;}
#d2 {
	top:19px;
	left:19px;
	z-index:2;
}
#d3 {
	top:21px;
	left:21px;
	z-index:2;
}
#d4 {
	top:19px;
	left:21px;
	z-index:2;
}
#d5 {
	top:21px;
	left:19px;
	z-index:2;
}
#d6 {
	top:19px;
	z-index:2;
}
#d7 {
	top:21px;
	z-index:2;
}

#d8 {
	top:18px;
	left:18px;
	z-index:1;
}
#d9 {
	top:22px;
	left:22px;
	z-index:1;
}
#d10 {
	top:18px;
	left:22px;
	z-index:1;
}
#d11 {
	top:22px;
	left:18px;
	z-index:1;
}
#d12 {
	top:18px;
	z-index:1;
}
#d13 {
	top:22px;
	z-index:1;
}
</style></head><body>
<div id="d1">CSS实现文字的边框效果</div>
<div id="d2">CSS实现文字的边框效果</div>
<div id="d3">CSS实现文字的边框效果</div>

</body></html>

 原理就是多层叠加,position偏移

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

单骑2009

如果帮到了您,请作者喝杯茶吧

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值