Hey there, I'm currently working with EJS. In my CSS file, I've added a background image but it's not showing up when the page loads. Strangely, if I use a hosted image, it works perfectly.
Here is my directory structure:
https://i.sstatic.net/Y3MQA.png
style.css file:
.bgimg-1 {
background: url('../img/cab.jpg');
height: 100%;
}
index.html code snippet:
<head>
<link rel='stylesheet' href='../public/css/style.css' type="text/css">
</head>
<body>
<div class="bgimg-1">
<div class="caption">
<span class="border"><a href="/api/login">LOGIN</a></span>
</div>
</div>
</body>
app.js setup:
app.use(express.static(path.join(__dirname + '/public')));