gpt4 book ai didi

html - html和css中页面的大小

转载 作者:行者123 更新时间:2023-11-28 16:38:06 26 4
gpt4 key购买 nike

我使用 HTML 和 CSS 设计一些东西,然后在我的网络浏览器中查看它的输出。当我调整网络浏览器大小时,我的设计会根据网络浏览器的大小发生变化。如何修复网页的大小?

<!DOCTYPE html><html>
<head>
<title>
my first page
</title>
<body>
<h1 style="font-type:italic;color:blue;text-align:center">
if music be the food of love, play on.</h1>
<h1>
If music be the food of love, play on.
</h1>
<h1>
If music be the food of love, play on. </h1>
<h1> If music be the food of love,
play on.
</h1 >
</body>
</head>

最佳答案

您的标记未包含在任何父容器中。 (默认的 <body> 标签除外)

您必须使用容器并指定所述容器的“大小”。

  • 使用 css 指定 body 标签的大小。或
  • 将您的标记放在包含的 DIV 中,并在 DIV 上应用 css 以赋予它特定的宽度值

关于html - html和css中页面的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24995599/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com