0

次のようなcssコードがあります。

@charset "utf-8";
/* long code  just an example of top */
     .show_hide_top a.showLink {        /* small red link */
     left: 39% !important;
     padding-left: 8px;
     top: 15% ;
     }


@media only screen and (min-width: 1300px) and (max-width:1500px) { 
     /* long code for these devices ex: */
 .show_hide_top a.showLink {      
    left: 39% !important;
    padding-left: 8px;
    top: 18% ;
    }
}
@media only screen and (min-width: 769px) and (max-width:1299px) {     
      code for these devices
}

@media only screen and (min-width:481px) and (max-width: 768px) {
      code for these devices
}

ただし、私のコンピューター (1600) は 1300-1500 のメディア コードを取得します。何か(おそらくばかげた)が間違っています。

ご意見ありがとうございます。

4

2 に答える 2

-1

メディア クエリを使用していたとき、Firefox は #upper のような一般的な ID を認識しませんでした。

例:

<div id="container">
   <div id='left"> content here </div>
   <div id="center">
      <div id="upper"> content here </div>
      ...
   </div>
   <div id="right">content here </div>
</div>

CSS で #center #upper をターゲットにするとすぐに、メディア クエリはターゲット メディアに対してのみ機能し、一般的なルールとしては機能しませんでした。

#アッパーだけ?いいえ...すべてのデバイスのメディアクエリを読み取って適用し、汎用CSSを上書きしていました。

最初は、min-devide-width と min-width の切り替えが機能しているように見えましたが、問題は解決しませんでした。したがって、これは恒久的な修正です。

汎用 CSS とメディア クエリの両方でフル パスを使用するようにしてください。

于 2013-10-17T17:16:50.413 に答える