Web/Styles

[CSS] 기기별 미디어쿼리

아랄라랄라 2019. 9. 10. 16:57

디바이스별 미디어 쿼리 정리속성으로 구분

 

/* 스마트폰 (가로/세로): */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
       /* Styles */
}


/* 스마트폰 (가로): */
@media only screen and (min-width : 321px) {
       /* Styles */
}


/* 스마트폰 (세로): */
@media only screen and (max-width : 320px) {
       /* Styles */
}


/* iPad (가로/세로): */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {
       /* Styles */
}


/* iPad (가로): */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) {
       /* Styles */
}


/* iPad (세로): */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {
       /* Styles */
}


/* 데스크탑 브라우저 (가로): */
@media only screen and (min-width : 1224px) {
       /* Styles */
}


/* 큰 모니터: */
@media only screen and (min-width : 1824px) {
       /* Styles */
}


/* iPhone4와 같은 높은 해상도: */
@media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) {
       /* Styles */
}

 

 


 


파일로 구분 

 

/* 스마트폰 (가로/세로): */
<link rel="stylesheet" href="smartphone.css" media="only screen and (min-device-width : 320px) and (max-device-width : 480px)">


/* 스마트폰 (가로): */
<link rel="stylesheet" href="smartphone-landscape.css" media="only screen and (min-width : 321px)">


/* 스마트폰 (세로): */
<link rel="stylesheet" href="smartphone-portrait.css" media="only screen and (max-width : 320px)">


/* iPad (가로/세로): */
<link rel="stylesheet" href="ipad.css" media="only screen and (min-device-width : 768px) and (max-device-width : 1024px)">


/* iPad (가로): */
<link rel="stylesheet" href="ipad-landscape.css" media="only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape)">


/* iPad (세로): */
<link rel="stylesheet" href="ipad-portrait.css" media="only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait)">


/* 데스크탑 브라우저 (가로): */
<link rel="stylesheet" href="widescreen.css" media="only screen and (min-width : 1224px)">


/* 큰 모니터: */
<link rel="stylesheet" href="widescreen.css" media="only screen and (min-width : 1824px)">


/* iPhone4와 같은 높은 해상도: */
<link rel="stylesheet" href="iphone4.css" media="only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5)">

 






 

/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
##Device = 데스크탑
##Screen = 1281px 이상 해상도 데스크탑
*/

@media (min-width: 1281px) {

//CSS

}

/*
##Device = Laptops, Desktops
##Screen = B/w 1025px to 1280px
##Device = 랩탑, 데스크탑
##Screen = 1025px에서 1280px 사이
*/

@media (min-width: 1025px) and (max-width: 1280px) {

//CSS

}

/*
##Device = Tablets, Ipads (portrait),
##Screen = B/w 768px to 1024px
##Device = 태블릿, 아이패드(세로),
##Screen = 768px에서 1024px 사이
*/

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

//CSS

}

/*
##Device = Tablets, Ipads (landscape)
##Screen = B/w 768px to 1024px
##Device = 태블릿, 아이패드(가로)
##Screen = 768px에서 1024px 사이
*/

@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {

//CSS

}

/*
##Device = Low Resolution Tablets, Mobiles (Landscape)
##Screen = B/w 481px to 767px
##Device = 저해상도 태블릿, 모바일(가로)
##Screen = 481px에서 767px 사이
*/

@media (min-width: 481px) and (max-width: 767px) {

//CSS

}

/*
##Device = Most of the Smartphones Mobiles (Portrait)
##Screen = B/w 320px to 479px
##Device = 대부분의 스마트폰 모바일 기기(세로)
##Screen = 320px에서 479px 사이
*/

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

//CSS

}
// ##출처: https://gist.github.com/gokulkrishh/242e68d1ee94ad05f488

 

728x90