0

背景画像があります。サイズは幅200px、高さ120pxです。ウェブサイトをレスポンシブ対応にリニューアル中です。高さを取り除くと、画像が完全に消えます。

それが私が持っているものです:

height: 120px;
background: url('../img/index.png') no-repeat center;
-webkit-transition: all ease 1s;
-moz-transition: all ease 1s;
-o-transition: all ease 1s;
-ms-transition: all ease 1s;
transition: all ease 1s;

高さをなくして、画像を失うことなくレスポンシブにするにはどうすればよいですか?

4

3 に答える 3

0

あなたはこれを見ることができます:

    background-size: contain;
    background: url('img/index.png') no-repeat center;
    max-width: 120px;
    max-height: 200px;
于 2013-10-15T15:41:53.580 に答える
-1

max-width および max-height プロパティを調べてみましたか?

于 2013-10-15T15:33:06.803 に答える