html - 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); }
解决方案
请试试这个。
#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; }
推荐阅读
- javascript - 有没有办法在我的 html 页面上执行 JavaScript/JQuery 函数一段指定的时间然后停止执行?
- npm - 如何修复 gulp-sass 中发现的漏洞。(tar 导致此问题)
- android - 从 github 导入项目时出现 Gradle 错误
- python - 使用不同的色调分组覆盖对 seaborn 的 FacetGrid 的多个调用
- vb.net - 变量在循环时会覆盖自己
- python - 如何调用函数在按键上打印 Turtle 的坐标?
- c# - 已安装 Ninject 包但未找到
- sharepoint-2013 - 根据一行中的空白列数计算列
- c++ - 有人知道如何终止 ESP8266 http Web 服务器/接入点
- tensorflow - 仅在使用 Keras Sequential 时出现不兼容的形状错误