【发布时间】:2023-03-08 21:56:01
【问题描述】:
我是 HTML 新手,现在正在尝试学习和整理。 我了解了元标记,它是数据的数据。 我了解了将设备宽度用于各种类型的设备(例如手机)的概念。
这是我写的代码
<!DOCTYPE html>
<html>
<head>
<title>question</title>
<meta name="viewport" content="width=100">
</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 survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</body>
</html>
我打算将我的整个 HTML content=body 设置为宽度 100 px,因为我写了 viewport width 100,但它在任何设备上都不起作用。
我认为无论我的浏览器或显示器的分辨率有多大,p 文本都会显示在 100 px 宽度内,但我看到的只是可调整大小的内容,这意味着 p 内容显示在我的浏览器的全宽。
我搜索了viewport 标签,但没有找到我正在寻找的东西,我只能假设我缺少一个 JSON 文件来使用 viewport 属性?
如果有人能帮助我理解这个问题,我会非常高兴! 提前感谢,我的知识背景只是 HTML 和一点 CSS,因为我一周前开始学习这些。
【问题讨论】: