gpt4 book ai didi

html - 右 Angular css中的三 Angular 形叠加

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

我想用 css 在一张图片上创建一个叠加层,如下所示: enter image description here

但我只做这样的方形叠加: enter image description here

我如何使用 CSS 制作第一个形状??

这是我的代码:

.card-img-overlay {
position: absolute;
top: 0px;
right: 0px;
bottom: 0;
left: 150px;
padding: 1.25rem;
}

谢谢你的回答:)

最佳答案

Check this out

#triangle-topleft {
width: 0;
height: 0;
border-top: 100px solid #9020d1bb;
border-left: 100px solid transparent;
position: absolute;
}

#container {
position: relative;
}

#container #triangle-topleft,
#overlay {
position: absolute;
color: white;
right: 0;
}
<div id="container">
<div id="triangle-topleft"></div>
<div id="overlay">Microsoft</div>
</div>

关于html - 右 Angular css中的三 Angular 形叠加,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48696350/

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