首页 > 解决方案 > 在html中使用时如何在bootstrap 4中更改img-thumbnail的白色

问题描述

这是我处理代码时的输出:

输出

我想让图像的边框变黑。我该如何改变呢?

<section style="background: #dfe6e9;" class="p-3">
  <div class="container">
    <div class="row">
      <div class="col-md-6">
        <img src="Profile-pic.jpg" width="500em" class="rounded-circle img-fluid img-thumbnail">
      </div>
      <div class="col-md-6">

      </div>
    </div>
  </div>
</section>

标签: htmlcssbootstrap-4

解决方案


要想真正实现你想要的,只需id在图片中添加一些(所以只有这个的 borded 更改)并在另外的 css 中.img-thumbnail更改background-color

<style>

#my-image.img-thumbnail {
   background-color: black;
}

</style>


推荐阅读