注釋:CSS opacity 屬性是 W3C CSS 推薦標(biāo)準(zhǔn)的一部分。
IE9, Firefox, Chrome, Opera 和 Safari 使用屬性 opacity 來設(shè)定透明度。opacity 屬性能夠設(shè)置的值從 0.0 到 1.0。值越小,越透明。
IE8 以及更早的版本使用濾鏡 filter:alpha(opacity=x)。x 能夠取的值從 0 到 100。值越小,越透明。
第一個 CSS 代碼塊類似實例 1 中的代碼。此外,我們已經(jīng)設(shè)置了當(dāng)鼠標(biāo)指針位于圖像上時的樣式。在這個例子中,當(dāng)指針移動到圖像上時,我們希望圖像是不透明的。
對應(yīng)的 CSS 是:opacity=1。
IE8 以及更早的瀏覽器:filter:alpha(opacity=100)。
當(dāng)鼠標(biāo)指針移出圖像后,圖像會再次透明。
This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box.
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。
新聞熱點
疑難解答