我有一個圖片大小:240px/240px。這個尺寸的圖片只能在寬屏幕上顯示,在手機上這張圖片必須是80px/80px。 我曾經嘗試過:如何減少背景圖片的大小?
.picture{
height:100%;
min-height: 240px;
background: url("../../img/picture.png") no-repeat;
background-size: cover;
background-position: 50% 50%;
}
@media screen and (max-width: 480px) .picture {
height: 80px;
transform:scale(.3);
}
但是這種規模的父母阻止,BG比例不對,完全正確的,但是這不是我所需要的。這只是作物bg圖片。
這是我所需要的。所有問題都在背景大小:封面;現在我使用背景大小:100%;在寬屏幕和背景大小上:25%;在移動。它是完美的。感謝提示! – ostinred
太棒了!別客氣 :) –