Html Bootstrap 4 img-circle 类不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41018489/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 14:06:23  来源:igfitidea点击:

Bootstrap 4 img-circle class not working

htmlcsstwitter-bootstrapbootstrap-4

提问by Cal Courtney

I'm writing a website in HTML5 and Bootstrap 4 and I'm trying to turn a square image into a circle. In Bootstrap 3 this was easily do-able with .img-circle, but now I can't seem to get it to work and I can't find any answers online. Has Bootstrap dropped the img-circle class or is my code messed up?

我正在用 HTML5 和 Bootstrap 4 编写一个网站,我正在尝试将一个方形图像变成一个圆形。在 Bootstrap 3 中,使用 很容易做到这一点.img-circle,但现在我似乎无法让它工作,而且我无法在网上找到任何答案。Bootstrap 删除了 img-circle 类还是我的代码搞砸了?

It goes something like this:

它是这样的:

<!-- Within a tab-content div --> 
<div class="col-xs-7">
    <img src="img/gallery2.JPG" class="img-circle" alt="HelPic>
</div>

Hope somebody can help me out :)

希望有人可以帮助我:)

回答by Zim

It's now called rounded-circleas explained here in the BS4 docs

它现在被rounded-circle称为BS4 文档中的解释here

<img src="img/gallery2.JPG" class="rounded-circle">

Demo

演示

回答by Sisindry Medagam

In Bootstrap 4it was renamed to .rounded-circle

Bootstrap 4 中,它被重命名为.rounded-circle

Usage :

用法 :

<div class="col-xs-7">
    <img src="img/gallery2.JPG" class="rounded-circle" alt="HelPic>
</div>

See migration docsfrom bootstrap.

从引导程序查看迁移文档

回答by Irving Jaime Salgado Linares

Now the class is this

现在课程是这样的

 <img src="img/img5.jpg" width="200px" class="rounded-circle float-right">