English 中文(简体)
CSS - Text Effects
  • 时间:2024-12-22

CSS Filters - Text and Image Effects


Previous Page Next Page  

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 −