gpt4 book ai didi

html - 在html中更改宽度和高度

转载 作者:太空宇宙 更新时间:2023-11-04 13:33:35 25 4
gpt4 key购买 nike

以下代码的宽度和高度随着不同设备分辨率的变化而变化。

<div style="background-color:orange;height:125px;width:75px;">
This div has height and width applied.
</div>

有什么方法可以防止宽度和高度的变化,并使其在所有分辨率下保持相同的宽度和高度。

注意:为此,我还尝试缩放(放大和缩小)html 页面,这会改变 div 的宽度和高度。

最佳答案

您可能需要在 head 标签之间添加视口(viewport)元:

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

http://webdesign.tutsplus.com/articles/quick-tip-dont-forget-the-viewport-meta-tag--webdesign-5972

关于html - 在html中更改宽度和高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23198547/

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