gpt4 book ai didi

css - 裁剪背景 CSS

转载 作者:行者123 更新时间:2023-11-28 13:27:11 26 4
gpt4 key购买 nike

enter image description here HTML:

<div id="large">
<div id="medium">
<div></div>
</div>
</div>

CSS:

#large {
width:600px;
height:400px;
background:url('image.jpg');
}

#medium {
width:400px;
height:200px;
background:red;
opacity:.5;
}

#medium div {
width:300px;
height:50px;
background:?;
}

现在对于 #medium div 我想忽略 #medium 的背景,实现没有任何红色调的背景图像。

这可能吗?

最佳答案

我们可以通过对子 div 也使用相同的背景 url 来做一些技巧吗?

#medium div {
width:300px;
height:50px;
background:url('image.jpg');
background-position-x:34px;/*adjust yourself*/
background-position-y:45px;/*adjust yourself*/

}

view jsfiddle

关于css - 裁剪背景 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14029957/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com