我正在为使用我正在编辑的wordpress主题(编辑CSS)的桌面和移动用户制作网站。我的问题是前面的图像很大,而当分辨率较低的用户(即手机上)在网站上连接时,图像被调整大小,只显示一个小部分。下面是解释我的问题截图:使大图像响应?
这是正常的网站通过桌面用户访问:
在这里,皱缩网站时,与小分辨率用户在网站(即手机)连接
正如您所看到的,图像现在看起来很糟糕。当分辨率很低时整个图像适合该屏幕,是否有缩小图像的方法?
这里是CSS,我使用显示这样的画面: 这是DIV和集装箱一些段落
* =Featured Content
-------------------------------------------------------------- */
#featured {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
background-color: #ffffff;
border: 1px solid #e5e5e5;
border-radius: 40px;
padding-bottom: 40px;
width: 99.893617021277%;
}
#featured p {
font-size: 18px;
font-weight: 200;
line-height: 27px;
color: #8B0000;
padding-top:250px;
padding-left:50px;
text-align: left;
width:100%
}
#featured p1 {
font-size: 18px;
font-weight: 200;
line-height: 27px;
font-style:italic;
color: #8B0000;
padding-top:50px;
padding-left:50px;
text-align: left;
width:100%;
}
#featured-image {
margin: 40px 0 0 0;
}
#featured-image .fluid-width-video-wrapper {
margin-left: -20px;
}
.featured-image img {
margin-top: 44px;
}
这里是类图片:
.col-940new {
width: 100%;
height:460px;
background: url('uploads/19377249_ml-1024x6651.jpg');
}
,这里是HTML是用于此元素
<div id="featured" class="grid col-940new">
<div class="grid col-460">
<h1 class="featured-title">
</h1>
<h2 class="featured-subtitle">
</h2>
<p>
</p>
</div><!-- end of .col-460 -->
<div id="featured-image" class="grid col-460 fit">
</div><!-- end of #featured-image -->
</div><!-- end of #featured -->
编辑:
在应用了一些方法评论波纹管后,我试图解决问题,但现在有一个“空白”,我想要删除当用户连接到手机网站。
代码是相同的,除了该行补充说:
background-size: 100% auto;
使用背景尺寸:包含; –
@ C-Link我试过,但问题是,有很多没有使用的“白色空间”.... – user2496520
试试这个背景大小:100%自动; –