CSS文字描边怎么实现,急!

html-css013

CSS文字描边怎么实现,急!,第1张

楼上说法不大对啊。

我觉得他的意思应该是文字的滤镜属性。

一般情况下的浏览器都没有问题,IE6之前的版本可能不支持。

代码实现如下:

<style type=”text/css”>

body {

font:12px “Verdana”

filter:alpha(style=1,startY=0,finishY=100,startX=100,finishX=100)

background-color:#3366cc

}

.sizscolor {

font-size:14pxfont-weight:bold

position:absolute

padding:4px

filter:

Dropshadow(offx=1,offy=0,color=white)

Dropshadow(offx=0,offy=1,color=white)

Dropshadow(offx=0,offy=-1,color=white)

Dropshadow(offx=-1,offy=0,color=white)

}

#english {

font-size:9px

}

</style>

<span id=”english”>This is the prospect of filter - dropshadow.</span>

<br><br>

<div class=”sizscolor “>中文描边效果</div>

嗯,可以的。但是其实讲真这个效果不太常用呢,因为只支持Webkit

/* 宽度和颜色 */

-webkit-text-stroke: 4px navy

/* 默认 */

-webkit-text-stroke: inherit

-webkit-text-stroke: initial

-webkit-text-stroke: unset

即-webkit-text-stroke: <length><color>

<length>

文本描边宽.

<color>

文本颜色.

可以看出fillText实心文字先绘制,strokeText空心文字后绘制,他们坐标一致,所以直接覆盖可实心文字,形成了像文字内部描边

通过text-shadow添加文字阴影可以形成对文字的外描边

注释:Internet Explorer 9 以及更早版本的浏览器不支持 text-shadow 属性。

可以看下这个文章,关于text-shadow

https://www.cnblogs.com/wuchuanlong/p/5985350.html