Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css HTML5字体大小_Css_Html - Fatal编程技术网

Css HTML5字体大小

Css HTML5字体大小,css,html,Css,Html,我想做一个手机网站 如何使字体大小与手机屏幕的分辨率保持一致 <!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>

我想做一个手机网站 如何使字体大小与手机屏幕的分辨率保持一致

<!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>

p{字体大小:1em;
/*字体大小:20px*/
}

Lorem Ipsum只是印刷和排版行业的虚拟文本。Lorem Ipsum已成为行业标准
从16世纪开始,一个不知名的印刷商拿起一个印刷工具,把它拼凑成一本样本书。它有
它不仅存活了五个世纪,而且还跨越到了电子时代。


使用
em
而不是
px

例如:

font-size: 1.1em;

把meta放在标题部分

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


我使用了它,但它没有正常工作:(@EngMaisa阅读了一些关于响应式网页设计的文档,然后使用GeekyCenter的建议:)使用所有的高度和宽度,如字体大小:20%;在css中,还添加了标题在移动设备中测试之前,我如何测试它?我也使用了它,但不起作用。您可以共享您的代码,以便我可以捕获您的查询吗?我编辑了我的问题并编写了我的代码:)您可以尝试下面的一个吗。我试过了,没问题。在正文中选择你的字体。正文{font:normal 100%Calibri}p{font size:120%;}