css 转盘图像在响应时模糊

pu82cl6c  于 2023-01-27  发布在  其他
关注(0)|答案(1)|浏览(134)

当尝试响应时,旋转木马图像模糊。对齐正确,但当屏幕分辨率降低时,图像变得模糊。我正在使用Bootstrap。
网站-第一个轮播:https://www.asus.com/in/
(WHEN我尝试使用成像液,图像变小)
代码:

<div id="carouselExampleIndicators" class="carousel slide" data-bs-ride="true">
        <div class="carousel-indicators">
          <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
          <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button>
          <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button>
        </div>
        <div class="carousel-inner">
          <div class="carousel-item active">
            <img src="img/corasel-img1.jpg" class="d-block w-100" alt="...">
          </div>
          <div class="carousel-item">
            <img src="img/corasel-img2.jpg" class="d-block w-100" alt="...">
          </div>
          <div class="carousel-item">
            <img src="img/corasel-img3.jpg" class="d-block w-100" alt="...">
          </div>
        </div>
        <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="prev">
          <span class="carousel-control-prev-icon" aria-hidden="true"></span>
          <span class="visually-hidden">Previous</span>
        </button>
        <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="next">
          <span class="carousel-control-next-icon" aria-hidden="true"></span>
          <span class="visually-hidden">Next</span>
        </button>

CSS:

.carousel-item{
    height: 100vh;
    min-height: 300px;
}
.w-100{
    height: 100vh;
}

我的形象是模糊的,当它是有React的

tp5buhyn

tp5buhyn1#

尝试将对象拟合规则添加到图像元素。
为您提供的代码:

.carousel-item img{
   object-fit: cover;
}

相关问题