【发布时间】:2022-01-25 10:37:38
【问题描述】:
我有一个这样的 div:
现在我需要从这个形状中删除一部分圆圈,如下所示:
因此最终的形状应该是这样的:
所以我决定把图片作为我的div的背景。
<div class="col-4 customBack">
<div class="mainInfo">
<div class="circle2">
<img src="https://sitename.com/images/image.png">
</div>
<div class="paraDivRight2">
<h6 style="margin-top:5px;"><strong>Lorem Ipsum Dolor Simit</strong></h6>
<hr style="margin-top:-5px;">
<p style="margin-top:-10px;">012-3456789</p>
<p style="padding-top:5px;">ifno@sitename.com</p>
</div>
</div>
</div>
以下是样式:
.mainInfo{
background-color: #fff;
border: .01rem round #e0e1ed;
border-radius: 20px;
color: #585CA1;
width:100%;
height:5em;
box-shadow: 0px 0px 17px -5px rgba(0,0,0,0.75);
margin-top: 3em;
display: flex;
align-items: center;
justify-content: center;
}
.customBack{
background-image: url("/img/shadow3.png") !important;
}
.circle2 {
position: relative;
left:-60%;
width: 9em;
height: 9em;
background: #fff;
border-radius: 50%;
box-shadow: 0px 0px 17px -5px rgba(0,0,0,0.65);
}
.circle2 img {
position: absolute;
max-width: 85%;
border-radius: 50%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 100;
}
.paraDivRight2 {
position: absolute;
display: inline-block;
padding: 10px;
color:black;
top:0px !important;
padding-top:50px !important;
right: 20px;
text-align: right;
padding-right:50px !important;
}
.paraDivRight2 p {
line-height: 1em;
font-size: 10pt;
margin: 0;
letter-spacing: 1px;
}
如您所见,我已将背景放在.customBack 类中,但结果现在看起来像这样:
所以问题是,我怎样才能正确地将这个背景图像(shadow3.png)作为这个mainInfo div 的背景图像,这样需要移除的圆形一侧不会出现......
我真的被这个困住了,所以请帮帮我......
【问题讨论】:
标签: html css twitter-bootstrap bootstrap-4