レスポンシブWebデザインのサイトを作るときのMedia Queriesの順番を考えてみた


2013012701
WebMedia QueriesCSS調



Media Queries480px768px980px

1. PC


PCMedia Queries使PC
 /* デフォルト:980px以上用(PC用)の記述 */
@media screen and (max-width: 979px) {
 /* 979px以下用(タブレット用)の記述 */
}
@media screen and (max-width: 767px) {
 /* 767px以下用(タブレット/スマートフォン用)の記述 */
}
@media screen and (max-width: 479px) {
 /* 479px以下用(スマートフォン用)の記述 */
}

2. 


PCMedia Queries使
 /* デフォルト:479px以下用(スマートフォン用)の記述 */
@media screen and (min-width: 480px) {
 /* 480px以上用(タブレット/スマートフォン用)の記述 */
}
@media screen and (min-width: 768px) {
 /* 768px以上用(タブレット用)の記述 */
}
@media screen and (min-width: 980px) {
 /* 980px以上用(PC用)の記述 */
}

3. 



@media screen and (min-width: 980px) {
 /* 980px以上用(PC用)の記述 */
@media screen and (min-width: 768px) and (max-width: 979px) {
 /* 768px - 979px用(タブレット用)の記述 */
}
@media screen and (min-width: 480px) and (max-width: 767px)  {
 /* 480px - 767px用(タブレット/スマートフォン用)の記述 */
}
@media screen and (max-width: 479px) {
 /* 479px以下用(スマートフォン用)の記述 */
}

312


2IE8

IE8Media Queries使


Respond.jscss3-mediaqueries-js使IE8

IE8PC

IE8


IE8Respond.jscss3-mediaqueries-js使IEWindows Phone

IE8

IE8Respond.jscss3-mediaqueries.js使Media QueriesIE8

Respond.js使Media QueriesIE8

HTMLIE8CSS
<link href="common.css"type="text/css" media="all" />
<link href="modern.css"type="text/css" media="all and (min-width: 100px)" />
<!--[if lt IE 9]>
<link href="ie8.css"type="text/css" media="all" />
<![endif]-->

common.css
CSSmodern.cssMedia Queries使Media QueriesIE8IE8
ie8.cssIE8IE8

IEPCmodern.cssie.css





PC

IE8OK


Media Queries

HTML5CSS3Web

コメント

  • Twitterをフォロー
  • Facebookページを見る
  • RSSを登録

KATOSHUN.com | 加藤俊司作品集