我是 HTML 和 CSS 的新手,我被困在这里......
基本上,“粗体文本”不会是我在 CSS 中定义的 font-size
:
h1 {
font-family: 'Montserrat', sans-serif;
font-weight: 700;
line-height: 1.05;
letter-spacing: -2.7px;
font-size: 89px;
}
h1 small {
font-family: 'Raleway', sans-serif;
font-weight: 300;
letter-spacing: -2.7px;
font-size: 70px;
}
我遇到问题的类是 h1
,如您所见,font-size
被定义为 89px
但它一直显示Bootstrap 的默认 h1
大小:35-36px
或其他,我通过在 font-size: 89px 之后写
但这不是解决方案...... !important
来解决这个问题
这是 HTML 代码。 (不包括头部部分)
<body id="page-top">
<header>
<div class="header-content">
<h1><small><font color="black">Light Text</font></small></h1>
<h1><font color="black">Bold Text</font></h1>
<br>
<a class="btn btn-primary btn-xl page-scroll" href="#about">Find
Out More</a>
</div>
</header>
<!-- jQuery -->
<script src="js/jquery.js">
</script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js">
</script>
<!-- Plugin JavaScript -->
<script src="js/jquery.easing.min.js">
</script>
<script src="js/jquery.fittext.js">
</script>
<script src="js/wow.min.js">
</script>
<!-- Custom Theme JavaScript -->
<script src="js/creative.js">
</script>
</body>
</html>
最佳答案
您标记了这个根据页面大小调整文本大小的“jquery.fittext.js”脚本,很自然地您遇到了这个问题。此脚本将标签“h1”添加到“字体大小”。
关于html - 自定义 CSS 不会覆盖默认的 Bootstrap CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35830262/