ホームページのバナー画像にメディアクエリを追加しようとしています。私はそれが反応し、使用される画面に応じて3つの異なる画像サイズに更新したい。現在、中程度のサイズの画像のみが表示されます。私のコードに何が間違っているのかを教えてください。ありがとう。これらのメディアクエリはどのように動作させるのですか?
/*---------------------------------------------
Section#Slider [Banner Image]
-----------------------------------------------*/
/* NEXUS 5 Size 412px, XS
(less than 786px no media query since this is
default in Bootstrap)
*/
/* IPAD SIZE 768px and up, S*/
@media screen and (min-width: 550px) {
#slider {
background: url("../img/smartphoneweb_640x285.jpeg") no-
repeat;
background-size: cover;
background-attachment: fixed;
background-position: 10% 0%;
padding: 200px 0 280px 0;
position: relative;
}
}
/* MD, desktops, 992px and up */
@media (min-width: 950px) {
#slider {
background: url("../img/smartphoneweb_1280x570.jpeg") no-
repeat;
background-size: cover;
background-attachment: fixed;
background-position: 10% 0%;
padding: 200px 0 280px 0;
position: relative;
}
}
/* LG, large desktops, 1200px and up */
@media (min-width: 1200px) {
#slider {
background: url("../img/smartphoneweb_1920x855.jpeg") no-
repeat;
background-size: cover;
background-attachment: fixed;
background-position: 10% 0%;
padding: 200px 0 280px 0;
position: relative;
}
}
すぎのような最大幅を設定してみてください "(最小幅:950px)@mediaと(最大幅:1199px){" –
使用 '代わりに分'のMAX-width' -width' – Eranda
なぜですか?私は間違っていない場合でも彼は最小幅が必要です@エランド –