Bootstrap 响应式文本大小 [英] Bootstrap Responsive Text Size

查看:33
本文介绍了Bootstrap 响应式文本大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用引导程序构建响应式布局,目前正在使用 font-size:3em 定义一些标题;

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?

推荐答案

最简单的方法是使用 % 或 em 中的维度.只需更改基本字体大小,一切都会改变.

Simplest way is to use dimensions in % or em. Just change the base font size everything will change.

@media (max-width: @screen-xs) {
    body{font-size: 10px;}
}

@media (max-width: @screen-sm) {
    body{font-size: 14px;}
}


h5{
    font-size: 1.4rem;
}       

查看所有方式https://stackoverflow.com/a/21981859/406659

您可以使用视口单位(vh、vw...),但它们不适用于 Android <4.4

You could use viewport units (vh,vw...) but they dont work on Android < 4.4

这篇关于Bootstrap 响应式文本大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆