【问题标题】:How to make image cover responsive in mobile device by css code如何通过 css 代码使图像封面在移动设备中响应
【发布时间】:2021-08-04 15:31:15
【问题描述】:

我们在手机/平板电脑上的网站预览存在问题。 关于手机版,网站主页没有完全响应,主封面(https://mineteams.com)没有显示所有图片,而在它的演示版中不存在这个问题。

现在请您帮助我们解决这个问题。

PHP 代码:

<div class="pth-hero__scene pth-parallax" style="transform: translate3d(0px, 0px, 0px) rotate(0.0001deg); transform-style: preserve-3d; backface-visibility: hidden; pointer-events: none;">

CSS 代码:

      div.pth-hero__scene.pth-parallax {
        background:  no-repeat fixed center center / cover rgba(0, 0, 0, 0);
        height: 40%;
        left: 0;
        position: cover;
        top: 10%;
        width: 100%;
      }
    }

【问题讨论】:

    标签: css responsive-design responsive-images


    【解决方案1】:

    如果您想确保背景图片的所有图片也显示在较小的屏幕上,您需要将 background-size 设置为:

    .pth-hero__background-inner {
     background-size: contain !important;
    }
    

    关于您的主页没有完全响应:请更具体。

    【讨论】:

    • 感谢您的帮助,现在解决了在移动设备上显示响应式图像的问题。但是我们在移动/平板电脑上的网站预览还存在问题。关于移动版,网站主页没有完全响应,主封面(mineteams.com)doesn't show all text on it while in demo version of it does not exist.and the problem is just现在显示文本响应。现在请您帮助我们解决这个问题。谢谢
    猜你喜欢
    • 2014-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-22
    • 1970-01-01
    • 2020-07-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多