Css Text Effects
Css Text Effects
You can use CSS filters to add special effects to text, images and other aspects of a webpage
without using images or other graphics. Filters only work on Internet Explorer 4.0+,. If you
are developing your site for multi browsers, then it may not be a good idea to use CSS filters
because there is a possibility that it would not give any advantage.
In this chapter, we will see the details of each CSS filter. These filters may not work in your
browser.
Alpha Channel
The Alpha Channel filter alters the opacity of the object, which makes it blend into the background.
The following parameters can be used in this filter −
Parameter Description
style
The shape of the opacity gradient.
0 = uniform
1 = linear
2 = radial
3 = rectangular
Example
<html>
<head>
</head>
<body>
<p>Image Example:</p>
</html>
Motion Blur
Motion Blur is used to create blurred pictures or text with the direction and strength. The following
parameters can be used in this filter −
Parameter Description
add True or false. If true, the image is added to the blurred image; and if false, the
image is not added to the blurred image.
direction
The direction of the blur, going clockwise, rounded to 45-degree increments. The
default value is 270 left.
0 = Top
45 = Top right
90 = Right
180 = Bottom
270 = Left
strength The number of pixels the blur will extend. The default is 5 pixels.
Example
<html>
<head>
</head>
<body>
<p>Image Example:</p>
<p>Text Example:</p>
</html>
Chroma Filter
Chroma Filter is used to make any particular color transparent and usually it is used with images.
You can use it with scrollbars also. The following parameter can be used in this filter −
Parameter Description
Example
<html>
<head>
</head>
<body>
<p>Image Example:</p>
<img src="/images/css.gif"
alt="CSS Logo" style="Filter: Chroma(Color = #FFFFFF)">
<p>Text Example:</p>
</html>
Parameter Description
offX Number of pixels the drop shadow is offset from the visual object, along the x-axis.
Positive integers move the drop shadow to the right, negative integers move the
drop shadow to the left.
offY Number of pixels the drop shadow is offset from the visual object, along the y-axis.
Positive integers move the drop shadow down, negative integers move the drop
shadow up.
positive If true, all opaque pixels of the object have a dropshadow. If false, all transparent
pixels have a dropshadow. The default is true.
Example
<html>
<head>
</head>
<body>
<p>Image Example:</p>
<img src="/css/images/logo.png"
alt="CSS Logo"
style="Filter: Chroma(Color = #000000)
DropShadow(Color=#FF0000,
OffX=2,
OffY=2, Positive=1)">
<p>Text Example:</p>
</html>
Parameter Description
Example
<html>
<head>
</head>
<body>
<p>Image Example:</p>
<img src="/css/images/logo.png"
alt="CSS Logo"
style="Filter: FlipH">
<p>Text Example:</p>
</html>
Glow Effect
Glow effect is used to create a glow around the object. If it is a transparent image, then glow is
created around the opaque pixels of it. The following parameters can be used in this filter −
Parameter Description
Example
<html>
<head>
</head>
<body>
<p>Image Example:</p>
<img src="/css/images/logo.png"
alt="CSS Logo"
style="Filter: Chroma(Color = #000000) Glow(Color=#00FF00, Strength=20)">
<p>Text Example:</p>
</html>
Grayscale Effect
Grayscale effect is used to convert the colors of the object to 256 shades of gray. The following
parameter is used in this filter −
Parameter Description
Example
<html>
<head>
</head>
<body>
<p>Image Example:</p>
<img src="/css/images/logo.png"
alt="CSS Logo"
style="Filter: Gray">
<p>Text Example:</p>
</html>
Invert Effect
Invert effect is used to map the colors of the object to their opposite values in the color spectrum,
i.e., to create a negative image. The following parameter is used in this filter −
Parameter Description
Invert Maps the colors of the object to their opposite value in the color spectrum.
Example
<html>
<head>
</head>
<body>
<p>Image Example:</p>
<img src="/images/css.gif"
alt="CSS Logo"
style="Filter: invert">
<p>Text Example:</p>
Mask Effect
Mask effect is used to turn transparent pixels to a specified color and makes opaque pixels
transparent. The following parameter is used in this filter −
Parameter Description
Example
<html>
<head>
</head>
<body>
<p>Image Example:</p>
<img src="/css/images/logo.png"
alt="CSS Logo"
style="FILTER: Chroma(Color = #000000) Mask(Color=#00FF00)">
<p>Text Example:</p>
</html>
Shadow Filter
Shadow filter is used to create an attenuated shadow in the direction and color specified. This is a
filter that lies in between Dropshadow and Glow. The following parameters can be used in this filter
−
Parameter Description
color
The color that you want the shadow to be.
direction
The direction of the blur, going clockwise, rounded to 45-degree increments. The
default value is 270 left.
0 = Top
45 = Top right
90 = Right
180 = Bottom
270 = Left
Example
<html>
<head>
</head>
<body>
<p>Image Example:</p>
<img src="/css/images/logo.png"
alt="CSS Logo"
style="FILTER: Chroma(Color = #000000) Shadow(Color=#00FF00, Direction=225)">
<p>Text Example:</p>
</html>
Parameter Description
add A value of 1 adds the original image to the waved image, 0 does not.
Example
<html>
<head>
</head>
<body>
<p>Image Example:</p>
<img src="/css/images/logo.png"
alt="CSS Logo"
style="FILTER: Chroma(Color = #000000)
Wave(Add=0, Freq=1, LightStrength=10, Phase=220, Strength=10)">
<p>Text Example:</p>
</html>
Parameter Description
Example
<html>
<head>
</head>
<body>
<p>Image Example:</p>
<img src="/css/images/logo.png"
alt="CSS Logo"
style="Filter: Xray"">
<p>Text Example:</p>
</html>
Loading [MathJax]/jax/output/HTML-CSS/jax.js