gpt4 book ai didi

css - 如何让div透明?

转载 作者:太空宇宙 更新时间:2023-11-03 21:45:13 25 4
gpt4 key购买 nike

CSS 是否提供任何选项以在 Angular 落显示背景图像透明

而不是在 ( DEMO ) 中显示白色背景

避开白色区域

enter image description here

#octagon {
width: 100px;
height: 100px;
background: red;
position: relative;
margin: 50px auto 0;
}

#octagon:before {
content: "";
position: absolute;
top: 0;
left: 0;
border-bottom: 29px solid red;
border-left: 29px solid red;
border-right: 29px solid #eee;
width: 42px;
height: 0;
}

http://jsfiddle.net/L8JUJ/4/

最佳答案

Working Fiddle

对边距进行了细微的更改和调整。

CSS:

body{
background: url(http://placehold.it/350x150&text=FooBar1) repeat;
}
#octagon {
width: 100px;
height: 71px;
background: red;
position: relative;
margin: 99px 10px 0px 100px;
}

#octagon:before {
content: "";
position: absolute;
top: -29px;
left: 0;
border-bottom: 29px solid red;
border-left: 29px solid red;
border-right: 29px solid transparent;
width: 42px;
height: 0;
}

关于css - 如何让div透明?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20995519/

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