Is there a way to add a background image to a container and ensure it displays properly?
CSS CODE
.headerandmain::before {
background-image: url(Images/HomeImg2.jpg);
}
HTML CODE
<section class="headerandmain">
<header>
<nav>
<ul class="navlink">
<li class="navabout">
<a href="#">
About
</a>
</li>
<li class="navhome"><a href="#">
Home
</a>
</li>
<li class="navdownload">
<a href="#">Download</a>
</li>
<li class="navcontact">
<a href="#">
Contact
</a>
</li>
</ul>
</nav>
</header>
</section>
The use of '::before' in CSS is not working, but 'background-image(url)' is functioning correctly.