我有一个问题:为什么我不能看到我的整个背景图像在手机上,但我可以在桌面上?"
这是我的主页:http://odsgaardklausen.dk/cj/
我现在不知道,如果我犯了一个错误? /* Generelt */
html {
min-height:100%;
}
.frontimage{
background-image: url('img/frontimage.jpg') !important;
background-position: center center;
bottom: 0;
right; 0;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
background-color: #464646;
z-index: -1;
height: 100vh;
width: 100%;
}
.about-text{
margin:auto;
width:30%;
}
ul{
list-style-type: none;
}
#cj{
width:300px;
height:300px;
margin:auto;
}
#skills {
width:100%;
background-color: #fffaf5;
padding-top: 48px;
}
.row {
width:100%;
margin:0;
padding:0;
}
@media screen and (max-width: 767px){
.about-text{
margin:auto;
width:80%;
}
}
我认为这是因为background-size: "cover"。这意味着,你的背景图像比例要尽可能大,使背景区域完全被背景图像覆盖。背景图像的某些部分可能不在背景定位区域内。
试着把它添加到你的CSS顶部:
@media only screen and (min-width : 320px) {.frontimage{background-attachment: none !important;}}