html中亮度怎么写,html – 使用CSS更改背景的亮度
我想改變DIV背景的亮度,而不影響div中的其他內容.
當我在div上應用懸停亮度過濾器時,其中的其他元素也會受到影響.我不想要的.
我的另一個解決方案就是用照片編輯的替換div的背景.但是要求存儲量增加一倍,我不喜歡.
有沒有辦法改變背景圖像的亮度?
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');
}
上面是我用兩次嘗試創造所需效果的小提琴的鏈接.但兩者都有使用它的缺點.
提前致謝!
總結
以上是生活随笔為你收集整理的html中亮度怎么写,html – 使用CSS更改背景的亮度的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: spg app android,GitH
- 下一篇: android通话记录列表apk,and