[英]Font not rendering (using bootstrap)
So I am trying to use a custom font, actually I'm using two of them. 所以我尝试使用自定义字体,实际上我正在使用其中的两种。 However, only one of them is rendering in the website.
但是,其中只有一个正在网站中呈现。 I tried switching them around to make sure it wasn't the reference to the second font, but then it worked fine so it wasn't that.
我尝试切换它们以确保它不是对第二种字体的引用,但随后它工作正常,因此不是那样。 I can't figure out where I'm going wrong.
我不知道我要去哪里。 Oswald is the font rendering just fine.
Oswald的字体渲染就很好。 Quattracento is the one not working.
Quattracento是不起作用的。 Any advice?
有什么建议吗?
HTML: HTML:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Arrow's Edge - Our Services</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.css">
<link rel="stylesheet" href="css/style.css">
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- fonts -->
<link href='https://fonts.googleapis.com/css?family=Oswald:400,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Quattrocento' rel='stylesheet' type='text/css'>
</head>
<body>
<!-- HTML for navbar -->
<nav class="navbar nav navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand logo-fit" href="index.html"><img id ="logo-bar" src="images/logo-bar.png" alt="Arrow's Edge Logo"></a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<ul class="nav navbar-nav navbar-inverse navbar-right collapse navbar-collapse">
<li><a href="index.html">Home</a></li>
<li><a href="our-services.html">Our Services</a></li>
<li><a href="#" data-toggle="dropdown">About Us<span class="caret"></span></a>
<ul class="dropdown-menu inverse-dropdown">
<li><a href="blog.html">Blog</a></li>
<li><a href="our-story.html">Our Story</a></li>
<li class="divider"></li>
<li><a href="#">Facebook</a></li>
</ul>
</li>
<li><a href="contact-us.html">Contact Us</a></li>
</ul>
</div>
</nav>
<!-- end of HTML for navbar -->
<!-- HTML for Our Servies page -->
<div class="row">
<div class="col-md-4 col-lg-4 col-sm-4 col-xs-8 col-sm-offset-4 col-md-offset-4 col-lg-offset-4 col-xs-offset-2 text-center design-header"><p>Web Design</p>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-6 text-center">
<div class="custom"><span class="custom-header">Custom:</span> <br>
<span class="my-text">We have a passion for designing new, cutting edge websites that are tailored to your specific needs. Need a site for a small business? A blog? A fan page? No problem! We have you covered.</span>
</div>
</div>
</div>
</body>
</html>
CSS: CSS:
/* Style for the Our Services page */
.design-header {
font-family: 'Oswald', sans-serif;
font-size: 40px;
margin-top: 15px;
border-bottom: 2px solid black;
padding-bottom: 10px;
}
.custom {
margin-top: 50px;
margin-left: 25px;
}
.custom-header {
font-family: 'Oswald', sans-serif;
font-size: 25px;
}
.my-text: {
font-family: 'Quattrocento', serif;
}
You have a :
just after your CSS selector, remove it. 您在CSS选择器之后有一个
:
,将其删除。
/* Old CSS
.my-text: {
font-family: 'Quattrocento', serif;
} */
/* New CSS */
.my-text {
font-family: 'Quattrocento', serif;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.