2013-04-02 76 views

回答

7

我發現這一點,它一定會幫助你的。 語法是這樣的。

.thing_you_want_to_filter { 
    /* 
    these are all default values, note that hue-rotate and blur have units. 
    You'll also need to include the vendor prefixes. 
    */ 
    filter: grayscale(0); 
    filter: sepia(0); 
    filter: saturate(1); 
    filter: hue-rotate(0deg); 
    filter: invert(0); 
    filter: opacity(1); 
    filter: brightness(0); 
    filter: contrast(1); 
    filter: blur(0px); 

    /* Drop shadow has the same syntax as box-shadow – see below for why it's amazing! */ 
    filter: drop-shadow(5px 5px 10px #ccc); 
} 

Chrome 18.0+和Safari 6+是唯一支持此功能的瀏覽器。 對於Safari瀏覽器下6版本,它會是這樣:

.img 
{ 
    -webkit-filter:contrast(100%); /* play with the percentages */ 
    -webkit-filter:brightness(100%); 
} 

你可以讀到的資料自己

http://net.tutsplus.com/tutorials/html-css-techniques/say-hello-to-css3-filters/ http://css3.bradshawenterprises.com/filters/

+0

尼斯。怎麼沒有Firefox插件來調整圖像的顯示!? - 使用canvas不會很難,看起來也可以使用CSS。 – NoBugs