屏幕HTML元素大小

发布于 2025-01-31 08:41:24 字数 190 浏览 2 评论 0原文

我从设计师那里获得了XD.Adobe链接以将其实现为网页,因此我采用的是Adobe中存在的相同的PX尺寸,并将它们放到我的网页HTML元素上,但是我注意到的是HTML元素看起来更缩放。 - 在较大的屏幕中,因此,如果屏幕在XD中匹配屏幕大小。Adobe。网页将相同,否则会更大,我读到的解决方案之一是停止使用PX并开始使用%,但不会是适用,因为该项目将在几天后完成。

I got xd.adobe link from the designer to implement it as web pages, so I'm taking the same px sizes that exist in adobe and putting them to my web page HTML elements, but what I noticed is the HTML elements look more zoomed-in in bigger screen, so if the screen is matching the screen sizes in xd.adobe the webpages will be identical otherwise it will be bigger, I read one of the solution is to stop using px and start using %, but will not be applicable because the project will be finished after a couple of days.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

闻呓 2025-02-07 08:41:24

如果您试图将 px 转换为任何其他尺寸单元,我建议您使用 rem 单元进行。基本上 rem 单位相对于HTML根标签的大小。
为了进一步了解,我建议您通过此网站。
链接

这是转换的示例:

* {
  font-size: 16px;
}

h1 {
  font-size: 50px;
}

#first {
  font-size: 12px;
}
<html>

<body>
  <h1>My First Heading</h1>
  <p id="first">My first paragraph.</p>
  <p>My second paragraph.</p>
</body>

</html>

及其在 rem 中的等效CS:

* {
  font-size: 16px;
}

h1 {
  font-size: 3.125rem;
}

#first {
  font-size: 0.75rem;
}
<html>

<body>
  <h1>My First Heading</h1>
  <p id="first">My first paragraph.</p>
  <p>My second paragraph.</p>
</body>

</html>

If you are trying to convert the px to any other sizing units, than I would suggest that you do so using rem unit. Basically rem unit is relative to the size of html root tag.
To further understand it I recommend you to go through this site.
Link

Here is an example of conversion:

* {
  font-size: 16px;
}

h1 {
  font-size: 50px;
}

#first {
  font-size: 12px;
}
<html>

<body>
  <h1>My First Heading</h1>
  <p id="first">My first paragraph.</p>
  <p>My second paragraph.</p>
</body>

</html>

And its equivalent css in rem:

* {
  font-size: 16px;
}

h1 {
  font-size: 3.125rem;
}

#first {
  font-size: 0.75rem;
}
<html>

<body>
  <h1>My First Heading</h1>
  <p id="first">My first paragraph.</p>
  <p>My second paragraph.</p>
</body>

</html>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文