【问题标题】:Bootstrap 4 img-circle class doesn't seem to existBootstrap 4 img-circle 类似乎不存在
【发布时间】:2017-04-22 10:58:22
【问题描述】:
我正在用 HTML5 和 Bootstrap 4 编写一个网站,我正在尝试将一个方形图像变成一个圆形。在 Bootstrap 3 中,.img-circle 很容易做到这一点,但现在我似乎无法让它工作,而且我在网上找不到任何答案。
Bootstrap 删除了 img-circle 类还是我的代码搞砸了?
它是这样的:
<!-- Within a tab-content div -->
<div class="col-xs-7">
<img src="img/gallery2.JPG" class="img-circle" alt="HelPic">
</div>
希望有人能帮帮我:)
【问题讨论】:
标签:
html
css
twitter-bootstrap
bootstrap-4
【解决方案2】:
现在这个类是这样的
<img src="img/img5.jpg" width="200px" class="rounded-circle float-right">
【解决方案3】:
在 Bootstrap 4 和 Bootstrap 5 中是 .rounded-circle
用法:
<div class="col-xs-7">
<img src="img/gallery2.JPG" class="rounded-circle" alt="HelPic>
</div>
从引导程序查看迁移 docs。
【解决方案4】:
我是通过谷歌到达这里的,因为我无法在图像上获得圆角,这就是我的解决方法;
.rounded-xl {
border-radius: 1.5rem;
}