CSS control picture, table, background color gradient sample

Source: Internet
Author: User
Tags relative

CSS Filter is the unique technology of IE, other browsers do not support, so for the greatest compatibility and standardization, should try to avoid for IE to use the filter alone, if you need some special effects, should consider other browsers,
Picture gradients

Copy Code code as follows:


<img src= "width=400 height=300 style=" Filter:alpha (style=1,opacity=25,finishopacity=100,startx=50, finishx=100,starty=50,finishy=100) ">


Table gradients

Copy Code code as follows:


<table style= "Filter:alpha (style=1,opacity=25,finishopacity=100,startx=0,finishx=100,starty=0,finishy= 100); Background-color: #ff0000 ">


<tr><td>12345678901234567890</td></tr></table>


Background gradient

Copy Code code as follows:


. bgjb{


background:-webkit-gradient (Linear,left,right,from (#BDD4FD), to (#FFFFFF));


Background:-moz-linear-gradient (left, #BDD4FD, #FFFFFF,);


Filter:progid:DXImageTransform.Microsoft.gradient (startcolorstr= #BDD4FD, endcolorstr= #FFFFFF, gradienttype=1);


}/* also consider other browsers,


<div class= "BGJB" ></div>


<body style= "Filter:alpha (style=1,opacity=25,finishopacity=100,startx=50,finishx=100,starty=50,finishy= 100); Background-color:skyblue ">


<body leftmargin= "0" topmargin= "0" marginwidth= "0" marginheight= "0" style= "filter:progid:d XImageTransform.Microsoft.Gradient (gradienttype=0,startcolorstr= #46B5FF, endcolorstr= #ffffff) ">


<body leftmargin= "0" topmargin= "0" marginwidth= "0" marginheight= "0"


style= "FILTER:progid:DXImageTransform.Microsoft.Gradient


(gradienttype=0,startcolorstr= #46B5FF, endcolorstr= #ffffff) ">


<div style= "width:66;height:100%;float:left; FILTER:


progid:DXImageTransform.Microsoft.Gradient


(gradienttype=1,startcolorstr= #46B5FF, endcolorstr= #ffffff) "></div>


<div style= "width:66;height:100%;float:left; FILTER:


progid:DXImageTransform.Microsoft.Gradient


(gradienttype=1,startcolorstr= #ffffFF, endcolorstr= #46B5FF) "></div>


<div style= "width:66;height:100%;float:right; FILTER:


progid:DXImageTransform.Microsoft.Gradient


(gradienttype=1,startcolorstr= #ffffff, endcolorstr= #46B5FF) "></div>


<div style= "width:66;height:100%;float:right; FILTER:


progid:DXImageTransform.Microsoft.Gradient


(gradienttype=1,startcolorstr= #46B5FF, endcolorstr= #ffffff) "></div>


To keep elements in a table from being affected
Add style= "position:relative" to the elements inside; Property so that it is not affected by the example:

Copy Code code as follows:


[HTML]


<div style= "Width:200px;height:200px;filter:alpha (opacity=10); background-color:red;" >


<div style= "position:relative;" >123123</div>


</div>


[/html]
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.