Invert 屬性
Invert 會把物件的所有視覺屬性一併翻轉,包括色彩、飽和度與亮度值。表達式同樣簡潔:
Filter: Invert
來看看套用前後的變化:
原圖
Invert 屬性效果圖
可以看到,Invert 達到的其實就是一種「底片」的效果。有興趣就拿自己的圖來試試。
Glow 屬性
對物件套用 Glow 之後,它的邊緣就會產生類似發光的效果。表達式如下:
Filter: Glow(Color=color, Strength=strength)
Glow 只有兩個參數:Color 指定發光的顏色,Strength 指定發光強度,取值範圍 1 到 255。先來看加上 Glow 之後的效果:

是不是有種火焰燃燒的感覺?實現代碼如下:
<html>
<head>
<title>filter glow</title>
<style>
<!--
.leaf { position: absolute; top: 20px; width: 400px;
filter: glow(color=#FF3399, strength=15); }
/* 設定類別 leaf:絕對定位,Glow 濾鏡屬性,
發光顏色 #FF3399,強度 15 */
.weny { position: absolute; top: 70px; left: 50px; width: 300px;
filter: glow(color=#9966CC, strength=10); }
/* 設定類別 weny:絕對定位,Glow 濾鏡屬性,
發光顏色 #9966CC,強度 10 */
-->
</style>
</head>
<body>
<div class="leaf">
<p style="font-family: lucida handwriting; font-size: 54pt;
font-weight: bold; color: #003366;">
/* 設定字體名稱、大小、粗細、顏色 */
Leaf Mylove</p>
</div>
<div class="weny">
<p style="font-family: bailey; font-size: 48pt;
font-weight: bold; color: #99CC66;">
/* 設定字體名稱、大小、粗細、顏色 */
Weny Good!</p>
</div>
</body>
</html>
顏色值可以隨意替換,換一組色碼就會得到完全不同的發光調性,不妨多試幾種組合。
FlipH、FlipV 屬性
Flip 是 CSS 濾鏡的翻轉屬性,FlipH 代表水平翻轉,FlipV 代表垂直翻轉,表達式都很簡單:
Filter: FlipH Filter: FlipV
先看一張原圖:

接著分別對它做水平翻轉與垂直翻轉,圖片上方的文字也會一起翻轉。程式碼如下:
<html>
<head>
<title>flip CSS</title>
<style>
<!--
div { position: absolute; top: 20px; width: 300px;
filter: fliph; } /* 若要垂直翻轉則改為 flipv */
/* 定義 DIV 範圍內的樣式:絕對定位並套用翻轉。
注意:fliph 與 flipv 一次只能取其中一個 */
img { position: absolute; top: 70px; left: 40px;
filter: fliph; } /* 圖片套用與 DIV 相同的翻轉屬性 */
-->
</style>
</head>
<body>
<div>
<p style="font-family: bailey; font-size: 36pt;
font-weight: bold; color: rgb(10,128,156);">
/* 定義字體名稱、大小、粗細、顏色 */
Leaf Village</p>
</div>
<p><img src="ss05058.jpg"></p>
/* 載入一張圖片 */
</body>
</html>
程式碼產生的兩個效果分別如下:
水平翻轉
垂直翻轉
翻轉屬性的應用是不是相當簡單?由於它不做任何像素重算,只是把結果鏡像輸出,因此在處理文字與簡單圖形時特別流暢,很適合拿來做倒影、對稱構圖或方向相反的箭頭裝飾。