- CSS - Scrollbars
- CSS - Dimension
- CSS - Outlines
- CSS - Cursors
- CSS - Padding
- CSS - Lists
- CSS - Margins
- CSS - Borders
- CSS - Tables
- CSS - Links
- CSS - Images
- CSS - Text
- CSS - Fonts
- CSS - Backgrounds
- CSS - Colors
- CSS - Measurement Units
- CSS - Inclusion
- CSS - Syntax
- CSS - Introduction
- CSS - Home
CSS Advanced
- CSS - Validations
- CSS - Layouts
- CSS - Printing
- CSS - Aural Media
- CSS - Paged Media
- CSS - Media Types
- CSS - Text Effects
- CSS - @ Rules
- CSS - Pseudo Elements
- CSS - Pseudo Classes
- CSS - Layers
- CSS - Positioning
- CSS - Visibility
CSS3 Tutorial
- CSS3 - Box Sizing
- CSS3 - User Interface
- CSS3 - Multi columns
- CSS3 - Animation
- CSS3 - 3d transform
- CSS3 - 2d transform
- CSS3 - Web font
- CSS3 - Text
- CSS3 - Shadow
- CSS3 - Gradients
- CSS3 - Color
- CSS3 - Multi Background
- CSS3 - Border Images
- CSS3 - Rounded Corner
- CSS3 - Tutorial
CSS Responsive
CSS References
- CSS - Animation
- CSS - Units
- CSS - Web safe fonts
- CSS - Web browser References
- CSS - Color References
- CSS - References
- CSS - Quick Guide
- CSS - Questions and Answers
CSS tools
CSS Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
CSS Filters - Text and Image 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 multiple browsers, then it may not be a good idea to use CSS filters because there is a possibipty 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 −
Sr.No. | Parameter & Description |
---|---|
1 | opacity Level of the opacity. 0 is fully transparent, 100 is fully opaque. |
2 | finishopacity Level of the opacity at the other end of the object. |
3 | style The shape of the opacity gradient. 0 = uniform 1 = pnear 2 = radial 3 = rectangular |
4 | startX X coordinate for opacity gradient to begin. |
5 | startY Y coordinate for opacity gradient to begin. |
6 | finishX X coordinate for opacity gradient to end. |
7 | finishY Y coordinate for opacity gradient to end. |
Example
<html> <head> </head> <body> <p>Image Example:</p> <img src = "/css/images/logo.png" alt = "CSS Logo" style = "Filter: Alpha(Opacity=100, FinishOpacity = 0, Style = 2, StartX = 20, StartY = 40, FinishX = 0, FinishY = 0)" /> <p>Text Example:</p> <span style = "width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: blue; Filter: Alpha(Opacity=100, FinishOpacity=0, Style=1, StartX=0, StartY=0, FinishX=580, FinishY=0)">CSS Tutorials</span> </body> </html>
It will produce the following result −
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 −
Sr.No. | Parameter & Description |
---|---|
1 | 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. |
2 | 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 135 = Bottom right 180 = Bottom 225 = Bottom left 270 = Left 315 = Top left |
3 | strength The number of pixels the blur will extend. The default is 5 pixels. |
Example
<html> <head> </head> <body> <p>Image Example:</p> <img src = "/css/images/logo.png" alt = "CSS Logo" style = "Filter: Blur(Add = 0, Direction = 225, Strength = 10)"> <p>Text Example:</p> <span style = "width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: blue; Filter: Blur(Add = 1, Direction = 225, Strength = 10)">CSS Tutorials </span> </body> </html>
It will produce the following result −
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 −
Sr.No. | Parameter & Description |
---|---|
1 | color The color that you d pke to be transparent. |
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> <span style = "width: 580; height: 50; font-size: 30pt; font-family: Arial Black; color: #3300FF; Filter: Chroma(Color = #3300FF)">CSS Tutorials</span> </body> </html>
It will produce the following result −
Drop Shadow Effect
Drop Shadow is used to create a shadow of your object at the specified X (horizontal) and Y (vertical) offset and color.
The following parameters can be used in this filter −
Sr.No. | Parameter & Description |
---|---|
1 | color The color, in #RRGGBB format, of the dropshadow. |
2 | 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. |
3 | 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. |
4 | 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:drop-shadow(2px 2px 1px #FF0000);"> <p>Text Example:</p> <span style = "width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; filter:drop-shadow(3px 3px 2px #000000);">CSS Tutorials</span> </body> </html>
It will produce the following result −
Fpp Effect
Fpp effect is used to create a mirror image of the object. The following parameters can be used in this filter −
Sr.No. | Parameter & Description |
---|---|
1 | FppH Creates a horizontal mirror image |
2 | FppV Creates a vertical mirror image |
Example
<html> <head> </head> <body> <p>Image Example:</p> <img src = "/css/images/logo.png" alt = "CSS Logo" style = "filter: FppH"> <img src = "/css/images/logo.png" alt = "CSS Logo" style = "filter: FppV"> <p>Text Example:</p> <span style = "width: 300; height: 50; font-size: 30pt; font-family: Arial Black; color: red; filter: FppV">CSS Tutorials</span> </body> </html>
It will produce the following result −
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 −
Sr.No. | Parameter & Description |
---|---|
1 | color The color you want the glow to be. |
2 | strength The intensity of the glow (from 1 to 255). |
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> <span style = "width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; filter: Glow(Color=#00FF00, Strength=20)">CSS Tutorials</span> </body> </html>
It will produce the following result −
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 −
Sr.No. | Parameter & Description |
---|---|
1 | grayscale Converts the colors of the object to 256 shades of gray. |
Example
<html> <head> </head> <body> <p>Image Example:</p> <img src = "/css/images/logo.png" alt = "CSS Logo" style = "filter: grayscale(50%)"> <p>Text Example:</p> <span style = "width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; filter: grayscale(50%)">CSS Tutorials</span> </body> </html>
It will produce the following result −
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 −
Sr.No. | Parameter & Description |
---|---|
1 | 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 = "/css/images/logo.png" alt = "CSS Logo" style = "filter: invert(100%)"> <p>Text Example:</p> <span style = "width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; filter: invert(100%)">CSS Tutorials</span> </body> </html>
It will produce the following result −
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 −
Sr.No. | Parameter & Description |
---|---|
1 | color The color that the transparent areas will become. |
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> <span style = "width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; filter: Mask(Color=#00FF00)">CSS Tutorials </span> </body> </html>
It will produce the following result −
Shadow Filter
Shadow filter is used to create an attenuated shadow in the direction and color specified. This is a filter that pes in between Dropshadow and Glow. The following parameters can be used in this filter −
Sr.No. | Parameter & Description |
---|---|
1 | color The color that you want the shadow to be. |
2 | 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 135 = Bottom right 180 = Bottom 225 = Bottom left 270 = Left 315 = Top 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> <span style = "width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; filter: Shadow(Color=#0000FF, Direction=225)">CSS Tutorials </span> </body> </html>
It will produce the following result −
Wave Effect
Wave effect is used to give the object a sine wave distortion to make it look wavy. The following parameters can be used in this filter −
Sr.No. | Parameter & Description |
---|---|
1 | add A value of 1 adds the original image to the waved image, 0 does not. |
2 | freq The number of waves. |
3 | pght The strength of the pght on the wave (from 0 to 100). |
4 | phase At what degree the sine wave should start (from 0 to 100). |
5 | strength The intensity of the wave effect. |
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> <span style = "width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; filter: Wave(Add=0, Freq=1, LightStrength=10, Phase=20, Strength=20)">CSS Tutorials </span> </body> </html>
It will produce the following result −
X-Ray Effect
X-Ray effect grayscales and flattens the color depth. The following parameter is used in this filter:
Sr.No. | Parameter & Description |
---|---|
1 | xray Grayscales and flattens the color depth. |
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> <span style = "width: 357; height: 50; font-size: 30pt; font-family: Arial Black; color: red; filter: Xray">CSS Tutorials </span> </body> </html>
It will produce the following result −
Advertisements