2011-03-16 338 views
2

我有一個很多超鏈接的小html頁面,當我查看相同的頁面是一臺計算機上的web瀏覽器,看起來沒問題,當我查看iphone中的html頁面時,這些字母非常小&很難閱讀。自動調整大小的HTML頁面

如何使相同的HTML看起來自動調整大小,如果你在iphone &瀏覽器在電腦中查看?

謝謝。

回答

0

你必須做一個移動的CSS。

使用Mobile Device Detect PHP代碼爲:

require_once('mobile_device_detect/mobile_device_detect.php'); 

$mobile = mobile_device_detect(true,false,true,true,true,true,true,false,false); 

echo ($mobile) ? '<link rel="stylesheet" media="all" href="css/mobile.css" /><meta content="True" name="HandheldFriendly" /><meta content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" name="viewport" />' : '<link rel="stylesheet" media="all" href="css/main.css" />'; 

echo '<body'.($mobile ? 'onload="window.scrollTo(0, 1)"' : null).'>' ; 
+0

Thanks.Can't它做@ HTML的水平,我沒有在我的項目中使用PHP。 – Sharpeye500 2011-03-17 00:22:17

+0

這是不可能的,[javascript是不可取的](http://stackoverflow.com/questions/743129/mobile-detection-using-javascript/743139#743139) – 2011-03-17 01:09:56