html - 我的滑块图像未显示在移动浏览器中,但它们显示在桌面上
问题描述
.slide-4 {
background: url("images/slider2/10.png");
background-repeat: no-repeat;
background-size: cover;
background-position: center;
position: relative;
z-index: 99999;
}
.slide-5 {
background: url("images/slider2/12.jpeg");
background-repeat: no-repeat;
background-size: cover;
background-position: center;
position: relative;
z-index: 99999;
}
这是我的 css 代码,它们显示在移动浏览器中,但现在没有显示在移动浏览器中,而且所有图像大小都小于 1mb,最大图像大小为 804kb,
解决方案
请检查媒体查询中 div 是否具有“高度:自动”样式。没有内容的元素的背景图像只有在它具有固定高度时才有效。
推荐阅读
- google-cloud-functions - Google Cloud Functions 错误:“请求的资源上不存在‘Access-Control-Allow-Origin’标头”
- javascript - `iframe` 事件监听器如何检测 `escape` 键事件?
- sapui5 - sapui5 Internet Explorer 11 计划日历不起作用
- c++ - 对 vec2(x, y) 点的 std::vector 进行排序
- r - 将R中数据集中的每一行相互比较
- php - 如何在 WordPress 中为特定元素或功能执行 CSS 和 JS
- ios - 用于底部文本视图和顶部搜索栏的 IOS 键盘
- php - 图像到 base64 编码问题 - PHP
- jquery - 剑道网格显示奇怪的日期时间而不是 null
- react-native - 调度后状态为空