I'm having trouble getting an image to appear behind a link when I hover over it in my navigation. This is for a school project where I can only use css, html, and a bootstrap template. Here is the code snippet from my html:
<nav class="navbar navbar-expand-lg ">
<div class="container">
<button class="navbar-toggler navbar-toggler-left ml-auto" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav mx-auto">
<li class="nav-item">
<a class="nav-link" href="about.html"> Home </a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownPortfolio" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> SHOP </a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownPortfolio">
<a class="dropdown-item" href="portfolio-1-col.html"> BASICS </a>
<a class="dropdown-item" href="portfolio-2-col.html"> TOURIST </a>
</div>
</li>
</ul>
</div>
</div>
</nav>
I've tried adding styles in CSS to achieve this effect but so far, the image doesn't show up when I hover:
li:hover {
background-image: url(images/scribble.png);}
a:hover {
color: silver;
background-image: url(images/scribble.png);}
The CSS for changing the font color on hover works correctly. For reference, this site is what I am trying to replicate.