2014-03-13 20 views

回答

10

media-queries-for-standard-devices

/* 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 */ 
} 

對於視網膜顯示屏使用

@media 
    only screen and (-webkit-min-device-pixel-ratio: 2), 
    only screen and (min-resolution: 192dpi) { 
    /* Retina-specific stuff here */ 
} 
+0

謝謝bhai ..還需要檢測老鼠顯示。 –

+0

@iDevTechnolab:我現在也加了.. !! –

+0

@iDevTechnolab:檢查這太http://www.brettjankord.com/2012/11/28/cross-browser-retinahigh-resolution-media-queries/ –

2

請參閱本LINK知道如何使用媒體查詢爲不同的設備。

+0

謝謝您的幫助兄弟 –

+0

不客氣兄弟:) – Abhi