Use CSS3 to achieve the text stroke effect. [The effect is here, and the idea is here !], Css3 stroke
As an emerging front-end technology, CSS3 can achieve many complex changes, such as text strokes.
The text-shadow attribute is used here. As the name suggests, it adds a shadow effect to the text. Example:
Html code
- Text-shadow: 10px 5px 2px # f60;
Parameter descriptions for each location:
Html code
- Text-shadow: x displacement y displacement blur color
Where: x displacement and y Displacement Indicate the Offset Value of the Shadow relative to the text, which can be a negative value.
Now, the idea is simple: Make a 1px shadow of zero degree for all four directions.
Statement:
Html code
- -Webkit-text-shadow: #000 1px 0 0 0, #000 0 1px 0, #000-1px 0 0 0, #000 0-1px 0;
- -Moz-text-shadow: #000 1px 0 0 0, #000 0 1px 0, #000-1px 0 0 0, #000 0-1px 0;
- Text-shadow: #000 1px 0 0 0, #000 0 1px 0, #000-1px 0 0, #000 0-1px 0;
- * Filter: Glow (Color = #000, Strength = 1 );
This method is applicable to mainstream browsers.
In principle, text-shadow supports multi-direction shadow writing, but the cost is too much code!
<! -- EndF -->
CSS div text strokes are compatible with IE6 IE7 IE8 Firefox
<Style type = "text/css">
Body {font-size: 12px; font-family: Arial, Helvetica, sans-serif;
Filter: alpha (style = 1, startY = 0, finishY = 100, startX = 100, finishX = 100 );
Background-color: #666666;
}
. Sizscolor {
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 );
Text-shadow: 0 0 1px # FFF;
}
</Style>
</Head>
<Body>
<Span> filter for ie and css3 for firefox </span>
<Br/>
<Div class = "sizscolor"> Stroke Effect in Chinese </div>
</Body>
</Html>