最好的方法是每个叠加层。并用CSS做个圈!
<div class="wrapper">
<img src="#" class="img-responsive">
<div class="circle"></div>
</div>
.wrapper
有position: relative
和.circle
有position: absolute
和border-radius: 100%
。
包装器必须使用定位inline-block
。用居中包装text-align: center
。
将绝对定位的元素居中,如下所示:
.el {
position: absolute;
top: 50%;
margin-top: -(height / 2)%;
left: 50%;
margin-left: -(width / 2)%;
}
如果要将图像放在圆内,请增大圆。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句