jquery | 해상도별 레이아웃 _ Media Query

페이지 정보

작성자 maura80 작성일15-08-17 17:38 조회3,086회 댓글0건

본문

해상도별 레이아웃 _ Media Query?

요즘은 스마트폰, 모니터 등의 사이즈가 제 각각이라 여러 화면에서 제대로 보이게 하는게 참 중요한 문제인 것 같습니다.

그래서 오늘은 웹 서핑을 통해 모은 자료들을 가지고 해상도별 CSS를 적용하는 방법에 대해 정리해보겠습니다!

 

 

01/속성으로 구분


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

}


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

}


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

}


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

}


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

}


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

}


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

}


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

}


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

}
 

 

 

 

 


02/파일로 구분


스마트폰 (가로/세로):
<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)">  

 

댓글목록

등록된 댓글이 없습니다.