元视口宽度在 html 文件中不起作用

问题描述 投票:0回答:1

我是 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>

自从我写了

content=body
以来,我打算将我的整个 HTML
100 px
样式设置为宽度
viewport width 100
,但它在任何设备上都不起作用。

我认为无论我的浏览器或显示器的分辨率有多大,

p
文本都会显示在
100 px
宽度内,但我看到的只是可调整大小的内容,这意味着
p
内容以全宽显示我的浏览器。

我搜索了

viewport
标签,但没有找到我正在寻找的东西,只能假设我缺少使用视口属性的 JSON 文件?

如果有人能帮助我理解这个问题,我会非常高兴! 预先感谢,我的知识背景只是 HTML 和一点 CSS,因为我一周前开始学习这些。

html viewport meta-tags
1个回答
0
投票

从 MDN 文档中您可以看到它的内容:

对于设置初始或最大比例的页面,这意味着宽度 属性实际上转化为最小视口宽度。

请参阅以下链接了解更多信息:)

来自 MDN 的视口和宽度

© www.soinside.com 2019 - 2024. All rights reserved.