问题描述
当<h1>标签在超小或小屏幕尺寸下,有什么办法可以改变它的文本大小吗?
Is there any way to change the text size of <h1> tag when it goes on extra small or small screen size?
因为 <h1> 有自己的默认尺寸,对于中号来说是正常的,但对于小号和超小号来说非常大.
Because <h1> has its own default size which is normal for medium size but very large for small and extra small.
当它变为小屏幕尺寸或超小屏幕尺寸时,我想更改该尺寸.
I want to change that size when it goes to small screen size or extra small screen size.
推荐答案
您可以创建一个自定义的 .css 文件(例如:site.css),然后使用 @media 在不同的屏幕尺寸.要在引导程序中覆盖 h1 类,您必须在引导程序之后包含您的自定义 css.下面是site.css中h1的例子:
You can create a custom .css file (for example: site.css) and then use @media to create different behavior on different screen size. To override the h1 class in bootstrap, you have to include your custom css after the bootstrap. Below is the example of h1 in site.css:
h1 {
/* Extra small devices (phones, less than 768px) */
font-size: 10px;
/* Small devices (tablets, 768px and up) */
@media (min-width: 768px) {
font-size: 12px;
}
/* Medium devices (desktops, 992px and up) */
@media (min-width: 992px) {
font-size: 16px;
}
/* Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
font-size: 18px;
}
}
这是bootstrap目前使用的@media规则,官方文档见这里.
This is the @media rules which bootstrap currently use, the official docs can be seen in here.
这篇关于改变 <h1> 的大小响应引导时的标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)