I recently started my journey in the field of Web Development with Angela Yu's Web Development bootcamp. Currently, I am utilizing bootstrap v5, html5, and CSS3.
While working on a project, I encountered an issue where I wasn't able to modify the properties of the body tag using Tag selection. Here's a snippet of my index.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>TinDog</title>
<!-- External style Sheet -->
<link rel="stylesheet" href="css/styles.css">
// Bootstrap
...
</head>
<body>
<section id="title">
<!-- Nav Bar -->
...
</section>
</div>
</body>
</html>
Additionally, here's a snippet of my styles.css:
body{
font-family: 'Montserrat', sans-serif;
}
#title{
padding: 3% 15%;
background-color: #ff4c68;
font-family: 'Montserrat', sans-serif;
color: #ffffff;
}
...
Surprisingly, I applied a new class to the body tag and targeted it with the Class selector in the External Style sheet, which resolved the issue! Can anyone shed some light on the reason behind this?