gpt4 book ai didi

html - CSS:正文中的字体系列不适用于页面上的任何内容

转载 作者:太空宇宙 更新时间:2023-11-03 23:05:28 24 4
gpt4 key购买 nike

我在正文中添加了一个 google 字体字体系列,但它似乎并没有改变所有内容。问题是当我单独放置“font-family:'Quicksand',sans-serif;”在每个 css 大括号(标题、超大屏幕等)中出现新字体。

那么有人可以解释为什么我的页面没有选择 body 字体系列吗?这真让我沮丧。谢谢

index.html

    <!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Quicksand:400,300' rel='stylesheet' type='text/css'>
<link href="css/styles.css" type="text/css" rel="stylesheet"/>
<link href="css/bootstrap.css" rel="stylesheet">

</head>
<body>
<main>
<header>
<div class="row">
<div class="col-lg-6 col-sm-1 col-xs-4">
<img class="logo" src="" alt="Logo">
</div>
<div class="col-lg-6 col-sm-11 col-xs-8 title">

<h1>Testing</h1>
<h4>Front-End Ninja</h4>

</div>
</div>
</header>
<hr id="line">
<section>
<div class="jumbotron">
<div class="container">
<h1>Hello, world!</h1>
<p>...</p>
</div>
</div>
</section>
<hr id="line">
<section id="showcase">
<div class="row">
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="..." alt="...">
<div class="caption">
<h3>Appify</h3>
<p>...</p>
</div>
</div>
</div>

<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="..." alt="...">
<div class="caption">
<h3>Title Two</h3>
<p>...</p>
</div>
</div>
</div>

<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="../images/DeathtoStock_Wired7.jpg" alt="...">
<div class="caption">
<h3>Title Three</h3>
<p>...</p>
</div>
</div>
</div>
</div>


</section>
</main>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
</body>
</html>

样式.css

html, body {
padding: 0;
margin: 20px;
font-family: 'Quicksand', sans-serif;
}

header {
padding: 30px;
}

.logo {
height:100px;
width:100px;
border: 5px solid #f8981c;
border-radius: 100px;
}

.title {
text-transform: uppercase;
text-align:right;
font-weight: 900;
margin: ;
padding: 0;
}

#line{
border:0px;
height:4px;
width:95%;
background:#BCBBBB;
}

.jumbotron {
background: url(../images/DeathtoStock_Wired7.jpg) center center no-repeat;
background-size: cover;
height: 500px;
margin: auto;
}

.thumbnail {
text-transform: uppercase;
}

最佳答案

将您的 styles.css 放在 bootstrap.css 链接之后,因为 bootstrap 在 body 上定义了一个覆盖您的字体系列

关于html - CSS:正文中的字体系列不适用于页面上的任何内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34899776/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com