Home >Web Front-end >CSS Tutorial >CSS filter to achieve text stroke effect (FF and IE6 not supported)

CSS filter to achieve text stroke effect (FF and IE6 not supported)

WBOY
WBOYOriginal
2016-05-16 12:06:591848browse

experience: although the css filter effect is good-looking and easy to use, it is not practical for web page production because it does not support ff and ie6, span>artists are best not to use it in web page production, as this will reduce their technical content.

method 1:

<span style="position:absolute;width:150;filter:shadow(color=orange);font-size:45pt;color:yellow">文字</span>

method 2:

<p style="font-size:12px;height:12px;color:white;filter:glow(color=black,strength=1);">text描边字</p>

method 3:

<style. type="text/css">
body {font:12px "verdana";filter:alpha(style=1,starty=0,finishy=100,startx=100,finishx=100);background-color:#3366cc;}
span {
      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:14px;}
</style>
<span id="english">this is the prospect of filter - dropshadow.</span><span>中文描边效果</span>
.font {
         font-family: "新宋体";
          font-size: 12px;
          font-style. normal;
          color: #ffff00;
          padding:1px;
          letter-spacing: 2px;
         
    filter:
         dropshadow(offx=1,offy=0,color=black)
          dropshadow(offx=0,offy=1,color=black)
          dropshadow(offx=0,offy=-1,color=black)
          dropshadow(offx=-1,offy=0,color=black);
}

method 4:

#text { float:left; color:#c60a12; 
filter:dropshadow(offx=1,offy=0,color=#ffffff) 
dropshadow(offx=0,offy=1,color=#ffffff) 
dropshadow(offx=-1,offy=0,color=#ffffff) 
dropshadow(offx=0,offy=-1,color=#ffffff);
}

this effect is achieved using the css shadow filter. ordinary shadow filters will only produce projection in one direction. here, four directions of projection are defined, so a stroke effect is produced.

<p style="font-size:12px;height:12px;color:white;filter:glow(color=black,strength=1);">text描边字</p>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn