在移动设备上的字体大小极小 [英] Font size extremely small on mobile devices
问题描述
我在我的主体中的一个巨大的< div>
中有一个< p>
在 font-size
中有80%的html,并且我在页面下部有一个页脚< div>
我的身体。
I have a <p>
block in a huge <div>
in the main body of my html with 80% in font-size
, and also I have a footer <div>
in the lower part of my body.
页脚中的文本还有80% font-size
,如果我测试我的电脑是相等的,但如果我在移动设备中测试,页脚的文本是非常小,不可能读取。
The text in the footer has also 80% font-size
, and if I test it on my PC it is equal, but if I test it in a mobile device, the text of the footer is extremely small, impossible to be read.
这是怎么可能的?
我的主要文字:
<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%;
}
推荐答案
> 视口元标记 到您的文档?
Have you added the viewport meta tag to your document?
如果没有,请将其添加到您的头部:
If not, add this to your head section:
<meta name="viewport" content="width=device-width, initial-scale=1">
移动浏览器自然会尝试缩小以显示整个网页,就像桌面浏览器。
A mobile browser will naturally attempt to zoom out to display your entire web page like a desktop browser. The viewport meta tag scales your page to the device width.
相关文章:
- 两个视口的故事〜QuirksMode.org
- 使用视口元标记在移动浏览器上控制布局〜MDN
- A tale of two viewports ~ QuirksMode.org
- Using the viewport meta tag to control layout on mobile browsers ~ MDN
更多来自SO:
- position:fixed not working on mobile, works on desktop
- Position:fixed breaks font-size on mobile
这篇关于在移动设备上的字体大小极小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!