この画像(小さい灰色のもの)は、ウィンドウのサイズが変更されたときにdiv
(牧草地の画像)の下にとどきたいです。私は自動値で試しました属性には、私はそれが何と正確に何かを把握することはできません何かがあると思います。ありがとう!この画像をdivの下に貼り付ける方法
Codepen:http://codepen.io/anon/pen/zoEYgP
.images {
background: url("http://kingofwallpapers.com/meadow/meadow-008.jpg");
background-size: cover;
height: 780px;
/*position: relative;*/
}
.smaller {
text-align: center;
}
.smaller img {
position: relative;
bottom: -280px;
}
@media screen and(max-width: 768px) {
.images {
height: auto;
/*position: relative;*/
}
.smaller img {
width: 80%;
/*height: auto;*/
/*margin-bottom: 0px;*/
}
}
<section class="images">
<div class="smaller">
<img src="https://placeholdit.imgix.net/~text?txtsize=38&txt=400%C3%97500&w=400&h=500" alt="">
</div>
</section>
768px以下の画面のサイズを変更したときに、どのような種類の出力を探しているのでしょうか。 – Tushar
@ Tushar私は灰色の画像をアスペクト比を維持しながら80%の幅(または他の幅)と言い、それを草原の画像の底に貼り付けることができます。私はIE8 +の解決策を探していますが、IE9 +はまだ素晴らしいです – Smithy