데스크탑 브라우저, iPhone, iPad 모바일 브라우저 등에 스타일시트를 구분하기 위한 미디어 쿼리(Media Queries)를 Andy Clarke씨가 정리했습니다. 속성으로 구분하는 방법과 파일로 구분하는 두가지 방법을 모두 포함합니다.
속성으로 구분하기
스마트폰 (가로/세로):
@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)">
Comments
Got something to add? You can just leave a comment.
RT @firejune: 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from TweetDeck
RT @firejune: 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from twitter
@firejune 어떻게 아셨나요. 이게 지금 필요했는데 ㅋ
from TweetDeck
@zziuni @firejune 드디어 돌아오신듯.. :-)
from twitter
RT @firejune: 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from twitter
RT @firejune: 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from Topsy
RT @firejune: 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from twitter
RT @firejune: 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from twitter
RT @firejune: 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from 파랑새
디바이스별 미디어 쿼리 정의: 데스크탑 브라우저, iPhone, iPad 모바일 브라우저 등에 스타일시트를 구분하기 위한 미디어 쿼리(Media Queries)를 Andy Clarke씨가 정리했습니... http://firejune.com/1633
from Topsy
http://firejune.com/1633
from Topsy
“@icetea0111: http://firejune.com/1633”와우 유용한 정보네요 감사합니다^^
from Topsy
RT @firejune: 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from twitter
Firejune Blog - 디바이스별 미디어 쿼리 정의 http://firejune.com/1633 #yam
from Topsy
RT @firejune: 디바이스별 미디어 쿼리 정의 http://t.co/gSUBO2F
from Topsy
RT @firejune 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from Topsy
RT @firejune 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from Topsy
디바이스별 미디어 쿼리 정의 - Firejune Blog http://ff.im/sBX4z
from FriendFeed
RT @firejune 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from Topsy
@edkoon @firejune 웹/앱 이나, 아니면 HTML5로 우리랑 연동 테스트 함 해봐랑..ㅋ 좀 짱인 듯.. ㅋ
from twitter
RT @edkoon: RT @firejune 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from Topsy
Firejune Blog - 디바이스별 미디어 쿼리 정의 http://firejune.com/1633 이거슬 이용하면 기계에 따라 겁내 다르게 보이는 페이지를 쉽게만들 수 있겠근영!!! (사실 쉽지는 않지만... 낄낄)
from Topsy
디바이스별 미디어 쿼리 정의 - Firejune Blog http://bit.ly/cmqsg8
from twitter
RT @firejune 디바이스별 미디어 쿼리 정의 http://firejune.com/1633 디바이스별로 화면 가로 사이즈 최적화하려면 어뜩해야 하는지 써 놓은 것이다. 열라 찾던 것이었다.
from Topsy
RT @firejune: 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from twitter
RT @firejune 디바이스별 미디어 쿼리 정의 http://firejune.com/1633
from twitter
@firejune RT 디바이스별 미디어 쿼리 정의 http://t.co/BsCLucpR
from twitter
디바이스별 미디어 쿼리 정의 http://t.co/BsCLucpR @firejune 에서
from twitter
디바이스별 미디어 쿼리 정의 http://t.co/EbH9DhSC
from twitter
공부할껀 많고 머리는 386이고... @firejune RT 디바이스별 미디어 쿼리 정의 http://t.co/3sP7Gfzx
from twitter
디바이스별 미디어 쿼리 정의 ( http://t.co/jQPsWibI ) 하지만 난 실패...
from twitter
디바이스별 미디어 쿼리 정의 - Firejune http://t.co/efd0MZBX
from chrome-share
@firejune RT 디바이스별 미디어 쿼리 정의 http://t.co/9Oh84upr 유용하게 잘썼습니다. 정말 감사해요!
from twitter
디바이스별 미디어 쿼리 정의 http://t.co/yZq5nLUu @firejune 에서
from twitter
감사합니다. 내용좀 퍼가고 싶습니다. ㅠ
reply edit
퍼가셔도 좋습니다.
reply edit
Your Reaction Time!