I successfully incorporated Google Fonts into my code, but I'm encountering difficulties in customizing it. I have tried to specify the font-family as "Montserrat-Black" or other styles such as thin or light, but it doesn't seem to be taking effect. Even changing the regular style and attempting to modify it has not yielded successful results. Additionally, the font weights are also not displaying as intended. Bootstrap 4 is being used in my code along with the following snippets:
HTML
<meta charset="utf-8">
<title>TinDog</title>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@900&family=Ubuntu&display=swap" rel="stylesheet">
<!-- CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link rel="stylesheet" href="css/styles.css">
<!-- Font Awesome -->
<script src="https://kit.fontawesome.com/7258ec066a.js" crossorigin="anonymous"></script>
<!-- Bootstrap Scripts -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="33435c434356411d594073021d02051d03">[email protected]</a>/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
</head>
<body>
<section id="title">
<div class="container-fluid">
<!-- Nav Bar -->
<nav class="navbar navbar-expand-lg navbar-dark ">
<a class="navbar-brand">tinDog</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="">Download</a>
</li>
</ul>
</div>
</nav>
<!-- Title -->
<div class="row">
<div class="col-lg-6">
<h1>Meet new and interesting dogs nearby.</h1>
<button type="button" class="btn btn-dark btn-lg"><i class="fab fa-apple"></i> Download</button>
<button type="button" class="btn btn-outline-light btn-lg"><i class="fab fa-google-play"></i> Download</button>
</div>
<div class="col-lg-6">
<img src="images/iphone6.png" alt="iphone-mockup">
</div>
</div>
</div>
</section>
CSS
background-color: #ff4c68;
color: white;
}
body{
font-family: 'Montserrat-Thin', sans-serif;
}
.container-fluid{
padding:3% 15%;
}
h1{
font-family: 'Montserrat', sans-serif;
font-size: 3rem;
line-height: 1.5;
}
/* Navigation Bar */
.navbar{
padding-bottom: 4.5rem;
}
.navbar-brand{
font-family:"Ubuntu";
font-size: 2.5rem;
font-weight: bold;
}
.nav-item{
padding:0 18px;
}
.nav-link{
font-family:"Montserrat-Light";
font-size: 1.2rem;
}
While using the Montserrat-Black family in this code, I've noticed that applying
font-family:"Montserrat-Thin"
works fine within the body section, but when trying to use font-family:"Montserrat-Light"
for .nav-link, it doesn't take effect. Why could this discrepancy be happening?