After following a YouTube tutorial on building a website with Bootstrap, I encountered an issue when setting the background image to be responsive. The background didn't adjust as expected based on the video.
Below is my HTML code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>XxXx</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/style.css">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="85f5eaf5f5e0f7abeff6c5b4abb4b3abb5">[email protected]</a>/dist/umd/popper.min.js"></script>
</head>
<body data-spy="scroll" data-target="#navbarSupportedContent">
<!-- Home -->
<div id="home">
<nav class="navbar navbar-expand-md navbar-light fixed-top">
<a class="navbar-brand" href="#">
data-target="#navbarSupportedContent">
<span class="navbar-toggler-icon"> </span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="#home">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item dropdown" >
<a class="nav-link dropdown-toggle" href="#services" id="navbarDropdown" role="button"
data-toggle="dropdown">Our Services</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">1</a>
<a class="dropdown-item" href="#">2</a>
<a class="dropdown-item" href="#">3</a>
<a class="dropdown-item" href="#">4</a>
<a class="dropdown-item" href="#">5</a>
<a class="dropdown-item" href="#">6</a>
<a class="dropdown-item" href="#">7</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">Contact Us</a>
</li>
</ul>
</div>
</nav>
<!-- landning page -->
<div class="landing">
<div class="home-wrap">
<div class="home-inner"><img src="images/h2.png">
</div>
</div>
</div>
<div class="caption text-center">
<h1>XXXXX</h1>
<h3>xxxxxxxxxx</h3>
<a class="btn btn-outline-dark btn-lg" href="#contact">Contact</a>
</div>
<!--end of landing page -->
</div>
<!-- About -->
<div id="about" class="offset">
</div>
<!-- Services -->
<div id="services" class="offset">
</div>
<!-- Contact -->
<div id="contact" class="offset">
</div>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="75051a050510075b1f0635445b44443d47494f55">[email protected]</a>/dist/umd/popper.min.js"></script>
</body>
</html>
I attempted to add ".home-inner {background-image: url(images/h1.png);}" in my CSS file, but the image didn't load. I also tried adjusting the background-size and position properties, but none of them seemed to make a difference.