2013-04-01 108 views
-4

我想讓網站爲移動 我怎樣才能讓字體大小與手機屏幕的分辨率HTML 5種字體大小

<!DOCTYPE html> 
<head> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<style> 
p{font-size:1em; 
/* font-size:20px; */ 
} 
</style> 
</head> 

<body> 

<p> 
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard 
dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has s 
urvived not only five centuries, but also the leap into electronic . 
</p> 

</body> 
</html> 

回答

3

使用em代替px

例如綿延:

font-size: 1.1em; 
+0

我用它,但它不能正常工作:( –

+0

@EngMaisa閱讀自適應網頁設計的一些文件,然後使用GeekyCenter的建議:) –

+0

使用所有的高度和寬度%,如字體大小: 20%;在CSS中,並在標題 –

0

把meta放在標題部分。

<meta name="viewport" content="width=device-width, initial-scale=1"> 
+0

中添加如何在移動測試之前測試它? –

+0

我也使用它,但不工作 –

+0

你能分享你的代碼,所以我可以捕獲你的查詢嗎? – dsfg