html中亮度怎么写,html – 使用CSS更改背景的亮度
我想改變DIV背景的亮度,而不影響div中的其他內(nèi)容.
當(dāng)我在div上應(yīng)用懸停亮度過濾器時(shí),其中的其他元素也會(huì)受到影響.我不想要的.
我的另一個(gè)解決方案就是用照片編輯的替換div的背景.但是要求存儲(chǔ)量增加一倍,我不喜歡.
有沒有辦法改變背景圖像的亮度?
Random unaffected text
Random AFFECTED text (it glows)
#replace {
width:700px;
height:465px;
background-image:url('http://i42.tinypic.com/351dff5.jpg');
}
#brightnessfilter {
width:700px;
height:465px;
background-image:url('http://i42.tinypic.com/351dff5.jpg');
}
#brightnessfilter:hover {
-webkit-filter: brightness(1.3);
-moz-filter: brightness(1.3);
-o-filter: brightness(1.3);
-ms-filter: brightness(1.3);
}
#transparent {
position:relative;
top:400px;
width:700px;
height:65px;
background-color:rgba(0,.5);
border-radius:8px;
}
#text {
color:white;
font-weight:bold;
position:relative;
top:9px;
left:9px;
font-size:16px;
}
#replace:hover {
background-image:url('http://i40.tinypic.com/2cft7dl.jpg');
}
上面是我用兩次嘗試創(chuàng)造所需效果的小提琴的鏈接.但兩者都有使用它的缺點(diǎn).
提前致謝!
總結(jié)
以上是生活随笔為你收集整理的html中亮度怎么写,html – 使用CSS更改背景的亮度的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: spg app android,GitH
- 下一篇: 用CSS写出一个下拉菜单小箭头