如何更改.jumbotron
中.jumbotron
和段落的字体粗细?
我不希望我的font-weight
如此之大。
HTML:
<header>
<div class="container-fluid landing-page">
<div class="jumbotron vertical-center">
<h1>Embroider<span class="eze">eze</span></h1>
<p>Branding <span class="eze">●</span> Promotional Items <span class="eze">●</span> Reflective Tape <span class="eze">●</span> Gifts</p>
</div>
</div>
</header>
CSS:
.jumbotron {
color: #dbdbdb;
background-color: transparent;
text-align: center;
margin-top: 300px;
font-weight: 200;
}
此外,字体大小更改不起作用。
答案 0 :(得分:1)
默认情况下,bootstrap有一些h1和P的样式。如果你想覆盖try with this
.jumbotron h1{
font-weight: 800;
}
.jumbotron p{
font-weight: 800;
}
答案 1 :(得分:1)
你可以查看:
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
.jumbotron h1 {
color: #dbdbdb;
background-color: transparent;
text-align: center;
margin-top: 100px;
font-weight: 200;
font-size: 20px;
}
.jumbotron p {
color: #dbdbdb;
background-color: transparent;
text-align: center;
margin-top: 100px;
font-weight: 200;
font-size: 20px;
}
</style>
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<header>
<div class="container-fluid landing-page">
<div class="jumbotron vertical-center">
<h1>Embroider
<span>eze</span>
</h1>
<p>Branding
<span>●</span> Promotional Items
<span>●</span> Reflective Tape
<span>●</span> Gifts</p>
</div>
</div>
</header>
</body>
</html>
&#13;
答案 2 :(得分:1)
在BootStrap 4 Jumbotron中调整字体粗细的更新:
类似的语法 - 假设你在css文件中创建一个类,如下所示;
.jumbotron_text { font-weight: 600; }
并将其应用于jumbotron div中的p标签,如下所示;
<div class="jumbotron">
<p class=jumbotron_text">Some text here </p>
</div>
注意我使用600(范围是100,200,300,400,500,600,700,800,900)。
大多数字体的法线正常为500,粗体为700.
其他数字是浏览器的近似值,除非它特别以字体显示。