2016-03-31 13 views
-1

@mediaクエリを使用してhtmlページを応答可能なページに変換していますが、ページを応答ページに変換しようとしています。@media(min-width:)および(max-width:)クエリが正しく機能しない

私は私のCSSコード

@media(min-width:480px) and (max-width:959px) 
{ 
    body 
    { 
     background-color:red; 
    } 
} 

を使用していますが、私のブラウザの幅が942pxであるときに、背景色が変化しています。 と私は@media(min-width:480px) and (max-width:959px)のために書いているCSSコードです。 CSSスタイルは(max-width :)の場合のみうまく働いています。

これらのバグや問題があります。私はhtmlページを反応性の高いページに変換できません。

+3

お使いのブラウザの幅を作るため、このコードは、それを行うことになっているものだ....あなたのメディアクエリ内です。 – Lee

+0

https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries – wlalele

+0

提供されたコードが意図したとおりに機能するので、ご質問ください。幅が480ピクセルになると、幅が960ピクセルに達するまで背景が赤くなります。 – Roman

答えて

2

使用常に応答

@media screen and (max-width: 1024px){ 

    /*Your style put here*/ 

} 

@media screen and (max-width: 768px){ 

    /*Your style put here*/ 

} 

@media screen and (max-width: 640px){ 

    /*Your style put here*/ 

} 

@media screen and (max-width: 480px){ 

    /*Your style put here*/ 

} 

@media screen and (max-width: 360px){ 

    /*Your style put here*/ 

} 

@media screen and (max-width: 320px){ 

    /*Your style put here*/ 

} 
関連する問題