在每个移动设备上获取正确的字体大小 [英] Getting the right font-size on every mobile device
本文介绍了在每个移动设备上获取正确的字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的移动应用中,我使用了一些大字体,例如:
In my mobile app I use kind of big fonts for example:
<b style="font-size:100px; font-family:Segoe UI">text</b>
当我在手机上对其进行测试时,它看起来不错,但是在较小的手机上,它的尺寸仍然相同,而且太大了.
When I test it on my phone it looks great but on a smaller phone it's still the same size and it is too big.
我应该使用什么CSS设置在每部手机上获得相同的尺寸?
What css settings should I use to get the same size on every phone?
推荐答案
您应该将媒体查询用于不同的设备宽度.
You should be using Media Queries for different device widths.
@media only screen and (max-width: 768px) {
b {
font-size: 20px;
}
}
@media only screen and (max-width: 320px) {
b {
font-size: 10px;
}
}
依此类推...
这篇关于在每个移动设备上获取正确的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文