首页 > 解决方案 > iPhone 中不显示背景图像

问题描述

我发现我的背景图片没有显示在 iPhone 上。但是,它在 android 设备中完美运行。请在这方面帮助我。我正在使用视差效果。

HTML部分:

<section id="showcase">
<div class="container text-center">
  <div class="home-search p-5">
    <div class="overlay p-5">

CSS部分:

 #showcase {
  background: url(../img/showcase.jpg) no-repeat top center fixed/cover ;
  position: relative;
  min-height: 650px;
  color: #fff;
  padding-top: 6rem; }

  #showcase .home-search {
    min-height: 400px;
    position: relative;
    border-radius: 5px; }
  #showcase .overlay {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    min-height: 400px;
    width: 100%;
    background: rgba(51, 51, 51, 0.8); }

标签: htmlcss

解决方案


请试试这个。

#showcase {
  background: url(../img/showcase.jpg);
   background-repeat:no-repeat;
   background-position:top center;
   background-size:cover;
  position: relative;
  min-height: 650px;
  color: #fff;
  padding-top: 6rem; }


推荐阅读