CSS implements two-color gradient of the background of a table

Source: Internet
Author: User

The principle is to use the Alpha filter to add a transparent gradient to each table, which is controlled by the background color of the table. A single td controls another gradient.
Alpha Filter
Syntax: {FILTER: ALPHA (opacity = opacity, finishopacity = finishopacity, style = style, startx = startx, starty = starty, finishx = finishx, finishy = finishy )}
Filter: Alpha (Opacity = 100, FinishOpacity = 0, Style = 1, StartX = 0, StartY = 0, FinishX = 0, FinishY = 100 );

The 'alpha' attribute is used to mix a target element with a background. The designer can specify a value to control the degree of mixing. In general, this "mixed with the background" is the transparency of an element. By specifying coordinates, you can specify the transparency of points, lines, and surfaces. Their parameter meanings are as follows:
"Opacity" indicates the level of transparency. The default range is from 0 to 100. They are actually percentages. That is to say, 0 indicates completely transparent, and 100 indicates completely opaque ." Finishopacity is an optional parameter. If you want to set the transparency of the gradient, you can use them to specify the transparency at the end. The range is also 0 to 100. The style parameter specifies the shape features of the transparent area. 0 represents a uniform shape, 1 represents a linear shape, 2 represents a radial shape, and 3 represents a rectangle ." STARTX "and" STARTY "represent the starting X and Y coordinates of the gradient transparency effect ." FINISHX "and" FINISHY "represent the coordinates of X and Y after the gradient transparency effect ends.

<Br/> <style type = "text/css"> <! --. Xr td {font-family: "Tahoma"; font-size: 12px; font-weight: bold; text-align: center; Filter: Alpha (Opacity = 100, finishOpacity = 0, Style = 1, StartX = 0, StartY = 0, FinishX = 0, FinishY = 100) ;}</p> <p> table {font-family: "Tahoma"; font-size: 12px ;} --> </style> <table width = "80%" border = "0" cellpadding = "5" cellspacing = "1" bgcolor = "#003399"> <tr bgcolor =" # FFFFFF "class =" xr "> <td width =" 20 "bgcolor =" #00 FFFF "> ID </td> <td bgcolor =" #99FF00 "> Name </td> <td bgcolor = "# FF0000"> ICQ </td> <td bgcolor = "# FFCC00"> MSN </td> <td bgcolor = "#66CC00"> homepage </td> <td bgcolor = "#003366"> Date </td> <td bgcolor = "# CC3300"> Content </td> </tr> <tr align = "center" bgcolor = "# FFFFFF"> <td> </td> <td> </tr> </table> <p>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.