---------------------------------------------------------------------------------
출처: http://danahae.cafe24.com/blog/
---------------------------------------------------------------------------------
@media all and (max-width:980px) { /* 화면 너비가 980px 이하일 때에만 아래 코드를 실행 */
.content{ float:none; width:auto } /* 콘텐츠 플롯을 해제하고 너비를 자동으로 */
.nav{ float:none; width:auto } /* 네비게이션 플롯을 해제하고 너비를 자동으로 */
}
via : http://naradesign.net/wp/2011/05/27/1483/comment-page-1/#comment-52959
스마트폰 (가로/세로):
@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)”>
VIA : http://truepia.tistory.com/234
'IT_Programming > HTML&CSS' 카테고리의 다른 글
[펌] CSS3 Media Query (0) | 2013.02.16 |
---|---|
HTML5 & Responsive Web Design. (0) | 2011.05.30 |
모바일 viewport 관련 내용 (0) | 2011.05.30 |
그림으로 설명하는 HTML5 Web Workers (0) | 2011.05.24 |
HTML5 개요와 기술적 특징 (0) | 2011.05.24 |