3

layout.css に何らかのスタイルを記述すると、すべての画面サイズに適用され、/* #Media Queries セクションには次のセクションがあります。

/* Smaller than standard 960 (devices and browsers) */
/* Tablet Portrait size to standard 960 (devices and browsers) */
/* All Mobile Sizes (devices and browser) */
/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */

したがって、これらのどれも私が望むことをしません。

大画面固有の CSS コードはどこに記述すればよいですか?

4

1 に答える 1

2

次のようなdivがあるとします<div claas="example"> </div>

.exampleメディアクエリで言及した範囲よりも大きい画面に適用されるcssを作成します

.example{
  /*..for larger screen style goes here....*/
 }
@media screen and (max-width: 1400px) { 
  .example {
    /*...now give style for those screen which are less than 1400px...*/
  }
}
@media screen and (max-width: 1300px) {
  .example {
    /*...now give style for those screen which are less than 1300px...*/
  }
}

上記のコードでは、3つの異なるスタイルについて言及しています

  1. >1400px 画面サイズ
  2. 1300 ~ 1400px の画面サイズの場合
  3. <1300 ピクセルの画面サイズ

編集::

"/* 標準の 960 より大きい (デバイスとブラウザー) */"

.example{
  /*..style for larger than 960px....*/
 }
@media screen and (max-width: 960px) { 
  .example {
    /*..style for lesser than or equal to 960 px...*/
  }
}
于 2013-08-10T13:35:29.320 に答える