【发布时间】:2017-04-23 18:22:41
【问题描述】:
我的网站有问题。图片在桌面上看起来很棒,但在我的手机上看起来很糟糕,因为它放大了。
我该如何解决这个问题? 它不适用于
background-size:cover;
带背景的div有两个类
.content{
color: white;
font-family: "Another Typewriter";
width:100%; height:1000px;
font-size: 300%;
padding-left: 15%;
padding-right: 15%;
padding-top: 10%;
text-align: center;
background-size: cover;
}
.parallax{
height: 100%;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
#xyz{background-image: url(URLtoimage);}
Div 容器:
<div id="xyz" class="parallax content">
<legend class="text-center content-headline">XYZ</legend>
Some text
</div>
【问题讨论】:
-
你有更多的代码,比如你正在使用的 HTML 和 CSS 吗???
-
您是否添加了viewport meta tag?例如:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
标签: html css background responsive