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
Release: 2018-09-27 16:34:43
Original
1821 people have browsed it

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>
Copy after login

method 2:

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

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>
Copy after login
<span id="english">this is the prospect of filter - dropshadow.</span><span>中文描边效果</span>
Copy after login
.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);
}
Copy after login

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);
}
Copy after login

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>
Copy after login
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template