我正在使用-webkit-background-clip將背景圖像限制爲h2元素中的文本。CSS3 background-clip
我的問題是,用-moz-background-clip函數做同樣的方法嗎?這似乎只在WebKit瀏覽器工作,這表明它並沒有工作在Firefox:目前
#header h1 a{
background: url(img/logo-overlay.png) no-repeat #000;
-moz-background-clip: text; -webkit-background-clip: text;
color: transparent; -moz-text-fill-color: transparent; -webkit-text-fill-color: transparent;
text-decoration: none;
}
,在Firefox,文本是隱藏的(因顏色:透明和文本填充顏色:透明屬性),並且只有背景圖像和顏色在元素的矩形形狀中可見。
任何想法?
有趣。 Webkit瀏覽器中的「文本」值能夠實現這一點(放大):http://cl.ly/2Ame。那麼,它現在必須完全專有於Webkit。使用內容框不起作用 - 呈現完全相同的結果,因爲完全忽略了背景剪輯。這應該是不同的行爲?感謝您的迴應。 – Gavin 2010-08-30 13:50:53
'content-box'與'text'不一樣http://dabblet.com/gist/3180315 – 2012-07-26 05:00:02