
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
这是一个很棒的模版,你能在CSS-Tricks找到其它零碎的媒体查询。不管怎样我已经把他们的例子全拷下来了,那里面包括了成吨的实际的移动设备。这些代码甚至能针对视网膜屏设备,使用最小设备像素比例。
- /* Smartphones (portrait and landscape) ----------- */
- @media only screen
- and (min-device-width : 320px) and (max-device-width : 480px) {
- /* Styles */
- }
- /* Smartphones (landscape) ----------- */
- @media only screen and (min-width : 321px) {
- /* Styles */
- }
- /* Smartphones (portrait) ----------- */
- @media only screen and (max-width : 320px) {
- /* Styles */
- }
- /* iPads (portrait and landscape) ----------- */
- @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {
- /* Styles */
- }
- /* iPads (landscape) ----------- */
- @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) {
- /* Styles */
- }
- /* iPads (portrait) ----------- */
- @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {
- /* Styles */
- }
- /* Desktops and laptops ----------- */
- @media only screen and (min-width : 1224px) {
- /* Styles */
- }
- /* Large screens ----------- */
- @media only screen and (min-width : 1824px) {
- /* Styles */
- }
- /* iPhone 4 ----------- */
- @media only screen and (-webkit-min-device-pixel-ratio:1.5), only screen and (min-device-pixel-ratio:1.5) {
- /* Styles */}
复制代码
|
|
|
|
|
|