我在一个网站上有一个部分,我有多个图像块。我有两列多行。由于某些原因,边距和宽度不适用于这些图像。我的媒体查询中有以下代码,其中viewport
为640px或更少。每当您拖动页面的角落时,图像的大小都不会缩放。此外,左侧的图像保持原位,而不是随着边距移动。图像不适应宽度集
它被称为网站赞助商在viewport
640像素或更少的部分。
是什么导致图像在height
和width
以及边缘不能缩放?
正如你可以看到我有一个百分比的基础上定义的图像width
:
.b_250 img {
width: 55%;
height: auto;
}
.b_250 iframe {
width: 55%;
height: auto;
}
还有余量定义:
.sponsors {
width: 100%;
margin: 0 2.5%;
}
有谁看到我做错了吗?
<div id="sponsor-left">
<div class="b_250">
<a href="PMC-spray-foam-equipment"><img src="images/Contractor Images/PMC spray foam equipment for sale.jpg"></a>
</div>
<div class="b_250">
<a href="Green-Insulation-Technologies"><img src="images/Contractor Images/Green Insulation Technology 300x200.jpg"></a>
</div>
<div class="b_250">
<a href="Sprayworks-Equipment-Group"><img src="images/Contractor Images/Spray foam rigs for sale a series.jpg"></a>
</div>
</div>
<div id="sponsor-right">
<div class="b_250">
<a href="#"><img src="images/Ad Boxes/300x200.gif" alt=""></a>
</div>
<div class="b_250">
<a href="#"><img src="images/Ad Boxes/300x200.gif" alt=""></a>
</div>
<div class="b_250">
<a href="#"><img src="images/Ad Boxes/300x200.gif" alt=""></a>
</div>
<div class="b_250">
<a href="#"><img src="images/Ad Boxes/300x200.gif" alt=""></a>
</div>
</div>
.container {
width: 100%;
}
.content {
float: none;
text-align: center;
width: 100%;
}
/*----Second to Last Homepage Article---*/
#latestnews {
width: 100%;
text-align: center;
}
#latestnews .latestnews h2{
margin: 10px 5%;
font-size: 1.3em;
width: 90%;
}
#latestnews ul, #latestnews li{
text-align: center;
}
#latestnews li{
margin: 0 auto;
}
.latestnews img{
margin: 0 auto;
text-align: center;
}
#latestnews div.latestnews{
float:none;
width: 100%;
}
#latestnews p {
padding: 20px 10px;
clear: both;
}
#latestnews p.readmore{margin-top:10px; text-align:center;}
.column .sponsors {
width: 100%;
}
.column {
clear: both;
width: 100%;
margin: 0 auto;
}
.column .sponsors .b_250{
border: none;
}
.b_250 img {
width: 55%;
height: auto;
}
.b_250 iframe {
width: 55%;
height: auto;
}
.sponsors {
width: 100%;
margin: 0 2.5%;
}
.sponsors h2{
margin: 10px 5%;
font-size: 1.3em;
width: 90%;
text-align: center;
}
#sponsor-left {
float: left;
width: 45%;
}
#sponsor-right {
float: right;
width: 45%;
}
}
你想要图像是c输入和自动响应? –
我希望在640px视口中有两列图像,然后让这些图像自动响应。\ – Paul