此次,我主要向你们介绍一下CSS3下的-webkit-text-stroke属性,并分享几个用该属性制做的镂空文字效果。css
一、-webkit-text-stroke属性简介html
CSS边框的一个不足就是只有矩形的元素才能使用。-webkit-text-stroke能够为文字添加边框。它不但能够设置文字边框的宽度,也能设置其颜色。并且,配合使用color: transparent属性,你还能够建立镂空的字体。html5
二、一块儿看几个利用-webkit-text-stroke制做的文字特效css3
第一个CSS代码以下:web
[backcolor=white !important]显示效果:
<ignore_js_op> [backcolor=white !important]
chrome
第二个CSS代码以下:浏览器
显示效果:字体
<ignore_js_op> spa
第三个CSS代码以下,注意这个demo须要用基于webkit内核的chrome或者safari浏览器才能看,firefox上无效firefox
[backcolor=white !important][backcolor=white !important]
显示效果:
<ignore_js_op>
好了,以上就是-webkit-text-stroke的用法以及3个相关的在线例子,这个文字特效就介绍到这里了,谢谢阅读!
转载请自觉注明原文:http://www.itivy.com/html5/archive/2012/1/11/css3-webkit-text-stroke-demo.html