[英]how to do a transparency gradient on an element in css?
好的,我看到了兩種不同類型的透明度,第一種是這樣的alpha css:
div {
opacity: 0.5;
filter: alpha(opacity=50);
}
這種樣式使整個div(“自定義共享對話框”)和其他CSS(在頁面按鈕上創建線性漸變樣式)透明:
#bottom_fade { z-index: 99;
position: fixed;
bottom: 0%;
background-image: url("bottom-fade.png");
/*in your case use a grey image with transparency*/
}
或者,您可以使用覆蓋頁面所有按鈕的div並添加線性漸變:
#grad {
background: red; /* For browsers that do not support gradients */
background: -webkit-linear-gradient(red, yellow);
/* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(red, yellow);
/* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(red, yellow);
/* For Firefox 3.6 to 15 */
background: linear-gradient(red, yellow); /* Standard syntax */
}
希望這段摘要對您有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.