Html 手机上的封面背景尺寸
我的网站有问题。这张照片在桌面上看起来很棒,但在我的手机上看起来很糟糕,因为它放大了 我怎样才能解决这个问题? 它不适合任何人Html 手机上的封面背景尺寸,html,css,background,responsive,Html,Css,Background,Responsive,我的网站有问题。这张照片在桌面上看起来很棒,但在我的手机上看起来很糟糕,因为它放大了 我怎样才能解决这个问题? 它不适合任何人 background-size:cover; 具有背景的div有两个类 .content{ color: white; font-family: "Another Typewriter"; width:100%; height:1000px; font-size: 300%; padding-left: 15%;
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 id="xyz" class="parallax content">
<legend class="text-center content-headline">XYZ</legend>
Some text
</div>
XYZ
一些文本
也许您可以将其更改为背景大小:当屏幕宽度小于767px时包含我如何假设您正在使用背景附件:修复代码>,它不能在许多移动浏览器上工作。您必须使用媒体查询在小屏幕上滚动更改它
.parallax{
height: 100%;
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
@media screen and (max-width: 600px) {
.parallax {
background-attachment: scroll;
}
}
使用背景大小:100%100%;检查代码段视图
正文{
保证金:0;
}
.bg img{
背景:url('http://www.planwallpaper.com/static/images/6942095-abstract-background-wallpaper.jpg“)无重复中心;
背景大小:100%100%;
最小高度:100vh;
宽度:100%;
}
您是否有更多正在使用的HTML和CSS之类的代码???您是否包括这些代码?例如:
使用@media显示不同的图像和较小的屏幕宽度谢谢您的帮助,但它不起作用。我编辑了我的帖子并添加了div拥有的类。那么你还有一些其他问题。如果可能,添加html部分和背景图像。因为你的内容和视差类没有任何背景源