【发布时间】:2022-01-22 18:21:52
【问题描述】:
我有一个这样的 div:
<div class="p-5 mb-3 mainInfo">
<div class="circle"><img src="https://nanoclub.ir/images/cut.png"></div>
</div>
结果是这样的:
但是,它应该像这样在 div 中显示:
这是 CSS:
.mainInfo{
background-color: #fff;
border: .01rem round #e0e1ed;
border-radius: 20px;
color: #585CA1;
height:50px;
}
.circle {
position:absolute;
width:150px;
height:170px;
border-radius:50%;
background:#fff;
right:100px;
top:40%;
transform:translateY(-50%);
}
那么我怎样才能像预期的图像一样正确地将图像放置在circle div 中?
【问题讨论】:
-
你只定位了圆,还需要将
img定位在圆的div里面。
标签: html css twitter-bootstrap twitter-bootstrap-3