2013-05-15 50 views
0

我使用下面的東西,但不工作,我的頁面寬度是1170px,它不適合移動設備。在這個網站新的任何人都可以幫助我?提前致謝。對於移動設備使用1170px的頁面寬度,Viewport不起作用,該如何解決?

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=yes" /> 
<meta name="viewport" content="target-densitydpi=device-dpi" /> 
<meta name="HandheldFriendly" content="true"/> 
<meta name="viewport" content="width=device-width" /> 

<meta name="viewport" content=", initial-scale=0.5" /> 

<meta name="viewport" content="width=480, user-scalable = yes, initial-scale=1.0, maximum-scale=1, minimum-scale=1"> 
<meta name = "viewport" content = "width = device-width, initial-scale = 0.33, user-scalable = yes"></meta> 
<meta name = "viewport" content = "width = 980px, initial-scale=0.4, maximum-scale=1" /> 
<meta name="viewport" content="width=320, maximum-scale=1, minimum-scale=1, initial-scale=0"> 

回答

1

我建議使用下面的內容。

頭下:

<meta name="viewport" content="initial-scale=1.0"> 

在你的樣式表:

/* Smartphones (portrait and landscape) ----------- */ 
@media only screen 
and (min-device-width : 320px) 
and (max-device-width : 480px) { 
/* Your Styles */ 
} 

/* Smartphones (landscape) ----------- */ 
@media only screen 
and (min-width : 321px) { 
/* Your Styles */ 
} 

/* Smartphones (portrait) ----------- */ 
@media only screen 
and (max-width : 320px) { 
/* Your Styles */ 
} 

/* iPads (portrait and landscape) ----------- */ 
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) { 
/* Your Styles */ 
} 

/* iPads (landscape) ----------- */ 
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : landscape) { 
/* Your Styles */ 
} 

/* iPads (portrait) ----------- */ 
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : portrait) { 
/* Your Styles */ 
} 

/* Desktops and laptops ----------- */ 
@media only screen 
and (min-width : 1224px) { 
/* Your Styles */ 
} 

/* Large screens ----------- */ 
@media only screen 
and (min-width : 1824px) { 
/* Your Styles */ 
} 

/* iPhone 4 ----------- */ 
@media 
only screen and (-webkit-min-device-pixel-ratio : 1.5), 
only screen and (min-device-pixel-ratio : 1.5) { 
/* Your Styles */ 

把你所有的標籤,標識的,類選擇,等上面@media,你會得到你的東西正確適用於多種設備平臺。

希望這會有所幫助。

+0

是它的工作thnx內森 –

相關問題