- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
所以我正在制作一个基本网站。当我在桌面上打开它时一切正常,但是当我在我的 iPhone 上打开它时,主体的背景图像不会“覆盖”容器。
我在这里做错了什么? (我添加了背景附件:阅读 stackoverflow 上的解决方案后在移动设备上滚动,但没有用)。
这是正在发生的事情的图像:
这是它在桌面上的样子:
这是它在移动设备上的样子。
这是我的CSS:
@font-face {
font-family: rubikCustom;
src: url(Rubik-Regular.ttf);
}
html, body {
height: 100%;
width: 100%;
min-height: 100%;
}
.navbar {
background-color: #FFF;
}
.navbar-nav > li{
margin-left: 15px;
margin-right: 15px;
}
#home {
background: url(home_back_blur.png) no-repeat center center fixed;
display: table;
height: 100%;
min-height: 100%;
position: relative;
width: 100%;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
/* background-attachment:scroll */
@media only screen and (max-width: 480px) {
#home {
background-attachment:scroll;
}
}
#full-height-cont {
height: 100%;
width: 100%;
}
.landing-text {
display: table-cell;
text-align: center;
vertical-align: middle;
color: white;
font-family: rubikCustom;
}
最佳答案
background-size: cover
表示背景总是会增长到“覆盖”整个 div。
在桌面上,您的 div 是横向的(宽度长于高度)。在手机上,恰好是纵向(宽度小于高度)。您可以通过将 border: 1px solid red
添加到 #home
来验证这一点。
有两种可能的解决方案:在移动尺寸下改变元素的高度,或者改变background-size
属性
关于css - 背景不走封面大小bootstrap 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57135175/
我想递归地遍历一个目录,但我希望 python 在遇到包含超过 100 个文件的目录时从任何单个 listdir 中断。基本上,我正在搜索 (.TXT) 文件,但我想避免使用包含大型 DPX 图像序列
我正在尝试遍历列表(例如 sql 行)并为每一行触发例程。问题是传递给函数的值不会在运行时进行评估,因此根据函数执行所需的时间,它可能会使用下一行中的任何值而不是当前行。 我知道我可以在普通函数中提取
我需要以毫秒为单位的时间来处理大量事务,因此我想要正确且快速的东西。下面的工作会做得最好吗? : iMilli := int((time.Nanoseconds() % 1e6) / 1e3
我有以下目录/文件设置(已简化): Ce +---top.txt +---X0.0 | | | +---Y0.0 | | | | |
我遇到了类似的问题: Connecting to Redis To Go with PHP 基本上,我在 redis 中有这个 uri: redis://myusername:foopassword@
我阅读了下面的主题 Go: multiple value in single-value context 但我不明白这个解释在我的案例中。可能是因为我想使用 interface 在下面的情况下,我得到
我有一个模板,我想使用 text/template 评估各个字段包裹。我很难弄清楚评估应该如何工作,因为下面的代码似乎失败了。模板包是否足够强大以处理此类评估? type something stru
我编写了简单的服务器程序来从客户端接收数据。我有点不明白有时我从函数中得到错误 read tcp4 IP:PORT i/o timeoutint, err := conn.Read([]byte) 未
我只需要解码和更新 json 对象的特定值。问题是我不知道对象的完整结构。 encoding/json 包“忽略”/截断结构中未提供的字段,因此在编码时这些字段将丢失。 我想知道是否可以只解码我知道的
我正在尝试使用带有 C++ 目标的 ANTLR4 来实现 TSql 解析器。我抓取了语法文件 here .该jar用于制作相应的源文件(因冲突将TSqlParser.cpp中的NULL全部改为null
我在 win7 中使用 python 3.3.3 - 我只想列出网络目录中的所有文件。 import os for root, dirs, files in os.walk("X:\\network\
当我运行 go 脚本 ( go run example.go ) 时出现此错误 /home/travis/.gvm/gos/go1.1.2/src/pkg/github.com/user/exampl
我正在尝试通过 gmail API 发送电子邮件使用 Go但我发现文档非常有缺陷/令人困惑。这一次我看不到收据字段和电子邮件正文。 我不需要上传任何东西,所以我找到了 Simple upload ,
本人是一名专业的windows/.Net开发者,一直在慢慢学习rails/ruby/python/etc。在我有空的时候。在过去 8 年左右的时间里,我也一直在使用各种 Linux 发行版。然而,有一
我想知道是否可以使用 std http 来响应 http 请求打包并仍然保持 go 例程事件(例如运行任务密集型任务)。用例是我需要接收一个 http 请求,然后在几分钟后回调该服务 最佳答案 只需从
我想知道关于指针的最佳实践是什么。我应该在结构上还是在其字段上定义它们。我虽然定义一个指向结构本身的指针是有意义的,但这里有一个我觉得很有趣的例子。如果所有字段都是指针,为什么我不应该使用指向整个结构
我是一名优秀的程序员,十分优秀!