當前位置:軟件學堂 > 資訊首頁 > 網(wǎng)絡編程 > DIV+CSS > CSS濾鏡invert屬性(反相)

CSS濾鏡invert屬性(反相)

2012/11/25 16:47:18作者:佚名來源:網(wǎng)絡

移動端

【實例介紹】

CSS濾鏡invert屬性(反相)

使用invert濾鏡可以把對象的可視化屬性全部翻轉(zhuǎn),包括色彩、飽和度和亮度值。

【基本語法】

filter:invert

【語法介紹】

【實例代碼】

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>無標題文檔</title> </head> <style type="text/css"> .p { filter: Invert;} </style> </head> <body> <table width="340" height="199" border="0" align="center" cellpadding="5" cellspacing="5">    <tr>      <td align="center">原圖</td>      <td align="center">Invert效果</td>    </tr>   <tr> <td width="150" height="184"><img src="7.jpg" width="324" height="324" ></td> <td width="150"><img src="7.jpg" width="324" height="324" class="p"/></td>   </tr> </table> </body> </html>

【代碼分析】

在代碼中,filter:invert標簽用來設置反相,在瀏覽器中預覽效果,如圖所示。

反相invert運行效果

 【素材及源碼下載】

請點擊:CSS濾鏡invert屬性(反相) 下載本實例相關素材及源碼

 

標簽: CSS濾鏡  invert屬性