gpt4 book ai didi

image - 如何添加允许查看图像背景的边框 ("triangled")?

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

由于很难解释,我将向您展示我假装的图像。

问题不在于“三 Angular 形”,而在于要在三 Angular 形生成的“空间”中显示的图像背景。

enter image description here

最佳答案

这是我的方法,如何处理这个任务。我将伪元素 :before:aftertransform: skewX(deg)border-left 属性一起使用。这是代码片段:

.bg-arrow {
display: flex;
justify-content: flex-end;
background:url('http://wallpaperlepi.com/wp-content/uploads/2014/10/Stone-And-Star-Wallpaper.jpg') #ddd center center no-repeat;
background-size: cover;
}

.arrow-shape{
position: relative;
display: flex;
align-items: center;
justify-content: space-around;
width: 200px;
height: 100px;
background-color: #fff;
}

.arrow-shape:before,
.arrow-shape:after{
content: '';
position: absolute;
left: 0;
height: 50%;
width: 100%;
background-color: #fff;
border-left: 4px solid #000;
z-index: 1;
}

.arrow-shape:before {
top: 0;
transform: skewX(15deg) translateX(-30px);
}

.arrow-shape:after {
transform: skewX(-15deg) translateX(-30px);
bottom: 0;
}

.arrow-shape .text {
position: relative;
text-align: center;
z-index: 2;
}
<div class="bg-arrow">
<div class="arrow-shape">
<div class="text">
Lorem ipsum dolor sit amet consectetur.
</div>
</div>
</div>

关于image - 如何添加允许查看图像背景的边框 ("triangled")?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50385266/

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