gpt4 book ai didi

html - 移动设备上的字体非常小

转载 作者:技术小花猫 更新时间:2023-10-29 12:45:16 24 4
gpt4 key购买 nike

我有一个 <p> block 在一个巨大的 <div>在我的 html 主体中,80% 在 font-size 中, 我还有一个页脚 <div>在我 body 的下半部分。

页脚中的文字也有 80% font-size , 如果我在我的电脑上测试它是平等的,但是如果我在移动设备上测试它,页脚的文本非常小,无法阅读。

这怎么可能?这是什么解释,如何避免?

我的正文:

<div id="mainTextContainer" class="text">
<p>test text</p>
</div>

我的页脚:

<div id="cookiesBar">
<div>
Esta web utiliza 'cookies' para su navegación.
Al utilizar nuestros servicios aceptas su uso.
</div>
</div>

我的 CSS:

#cookiesBar {
display: none;
position: fixed;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
text-align: center;
height: auto;
background-color: rgba(136, 188, 182, 0.7);
z-index: 99999;
border-radius: 0px;
text-decoration: none;
line-height: 30px;
font-size: 80%;
font-family: verdana;
}

#mainTextContainer {
width: 80%;
margin: auto;
text-align: center;
margin-top: 60px;
}

.text {
font-size: 80%;
}

最佳答案

您是否已将视口(viewport)元标记添加到您的文档中?

如果没有,请将其添加到您的头部部分:

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

移动浏览器自然会像桌面浏览器一样尝试缩小以显示整个网页。 viewport 元标记将您的页面缩放到设备宽度。

更多信息:

关于html - 移动设备上的字体非常小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35563900/

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