引导响应文本大小 [英] Bootstrap Responsive Text Size
本文介绍了引导响应文本大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图使用bootstrap创建一个响应式布局,目前使用font-size定义一些标题:3em;
但是当布局缩小这太大了。
解决方案
最简单的方法是在%或em中使用尺寸。
@media(max-width:@ screen-xs){
body {font-size:10px;}
}
@media -width:@ screen-sm){
body {font-size:14px;}
}
h5 {
font-size:1.4 em;
}
查看 http://stackoverflow.com/a/21981859/406659
您可以使用视口单位(vh, vw ...),但他们不适用于Android& 4.4
I am trying to build a responsive layout using bootstrap and currently am defining some of the titles with font-size:3em;
But when the layout is shrunk down this is too big. How can I responsively reduce the size of the text?
解决方案
Simplest way is to use dimensions in % or em. Just change the base font size everything will change.
Less
@media (max-width: @screen-xs) {
body{font-size: 10px;}
}
@media (max-width: @screen-sm) {
body{font-size: 14px;}
}
h5{
font-size: 1.4em;
}
Look at all the ways at http://stackoverflow.com/a/21981859/406659
You could use viewport units (vh,vw...) but they dont work on Android < 4.4
这篇关于引导响应文本大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文