与我测试过的所有其他浏览器相比,现有的 Android 浏览器在处理我的图像大小方面有一种奇怪的方式。这是我正在使用的 HTML 和 LESS。
以下是一些屏幕截图:首先是 Android,然后是 Windows 上的 Chrome
安卓 4.1.1
Windows 7 上的 Chrome 26
它们应该是方形的,但显然不是。有谁知道如何解决这一问题?
<div class="album">
<img class="album_image" src="./images/albums-low/heart_of_nowhere.jpg">
<div class="album_inner">
<p class="album_artist_title">
<span>Heart of Nowhere</span> (2013)<br>Noah And The Whale
</p>
<div class="streams">
<div class='spotify'>
<a href='spotify:album:0t0QkoTnDz5uj5I92C7wwE'>
<img src='./images/icons/spotify.png'>
</a>
</div>
<div class='grooveshark'>
<a href='http://grooveshark.com/#!/album/Heart+Of+Nowhere/8927514'>
<img src='./images/icons/grooveshark.png'>
</a>
</div>
<div class='youtube missing'>
<a>
<img src='./images/icons/youtube.png' alt=''>
</a>
</div>
<div class='rdio'>
<a href='http://www.rdio.com/artist/Noah_and_the_Whale/album/Heart_Of_Nowhere/'>
<img src='./images/icons/rdio.png'>
</a>
</div>
</div>
<p class="added">+ 12 May 2013</p>
</div>
</div>
LESS:(这很混乱)
body {
background-color: #111;
padding: 0;
margin: 0;
font-family: 'Avenir', sans-serif;
}
.albums{
padding: 0 0 5px 5px;
}
.border-box-sizing{
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.album {
.border-box-sizing;
float: left;
color: #eee;
padding: 5px 5px 0px 0px ;
text-align: left;
z-index: 0;
background-color: none;
position: relative;
@media only screen and (max-width: 400px){ width: 100%; }
@media only screen and (min-width: 401px) and (max-width: 800px){ width: 50%; }
@media only screen and (min-width: 801px) and (max-width: 1200px){ width: 33.33%; }
@media only screen and (min-width: 1201px) and (max-width: 1600px){ width: 25%; }
@media only screen and (min-width: 1601px) and (max-width: 2000px){ width: 20%; }
@media only screen and (min-width: 2001px) and (max-width: 2400px){ width: 16.66%; }
@media only screen and (min-width: 2401px){ width: 14.29%; }
}
.album_inner{
.border-box-sizing;
position: absolute;
padding: 10px 10px 10px 10px;
top: 0;
left: 0;
height: 100%;
width: 100%;
opacity: 0;
display: none;
}
.album p{
margin: 0;
}
.album > img {
width: 100%;
float: left;
margin-right: 10px;
border-radius: 4px;
box-shadow: 0 0 4px #234;
cursor: pointer;
}
.streams{
width: 100%;
height: 100%;
padding: 56px 36px 16px 36px;
.border-box-sizing;
position: absolute;
top: 0;
left: 0;
> div {
width: 50%;
height: 50%;
float: left;
&.missing {
opacity: 0.1;
cursor: default;
}
> a {
width: 80%;
height: 80%;
margin: 10%;
display: block;
> img {
border-radius: 4px;
width: 100%;
height: 100%;
}
}
}
}
.added {
color: #999;
font-size: 11px;
line-height: 16px;
width: 100%;
text-align: center;
position: absolute;
bottom: 0;
z-index: 5;
}
.album_artist_title {
color: #eee;
padding-top: 6px;
font-size: 13px;
line-height: 16px;
width: 100%;
z-index: 10;
position: absolute;
text-align: center;
> span {
font-weight: bold;
}
@media only screen and (max-width: 400px){ font-size: 13px;}
@media only screen and (min-width: 401px) and (max-width: 600px){ font-size: 11px; }
@media only screen and (min-width: 601px){ font-size: 13px; }
}
@font-face {
font-family: 'Avenir';
src: url('./fonts/avenir/AVENIRLTSTD-MEDIUM.eot');
src: url('./fonts/avenir/AVENIRLTSTD-MEDIUM.eot?#iefix') format('embedded-opentype'),
url('./fonts/avenir/AVENIRLTSTD-MEDIUM.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}