【问题标题】: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


    【解决方案1】:

    现在将 rounded-circle 称为 explained here in the BS4 docs

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

    Demo

    【讨论】:

    • 但这不是一个圆圈。不是椭圆形的吗?
    • 如果图像不是正方形,它将是椭圆形。
    【解决方案2】:

    现在这个类是这样的

     &lt;img src="img/img5.jpg" width="200px" class="rounded-circle float-right"&gt;

    【讨论】:

      【解决方案3】:

      Bootstrap 4Bootstrap 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;
        }
        

        【讨论】:

          猜你喜欢
          • 2012-10-31
          • 1970-01-01
          • 2014-06-09
          • 2018-11-17
          • 2018-03-01
          • 1970-01-01
          • 2020-05-05
          • 1970-01-01
          • 2013-02-11
          相关资源
          最近更新 更多