Click here to Skip to main content
15,891,646 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Trying to add a background image of a cross to my .nav bar behind the menu.
the site is aelorics.com.

What I have tried:

I have tried several snipets od css adding them to simple css or the header.css file.

.x-navbar {
	background-image: url('IMAGE URL');
	background-size: cover;
}


.navbar {
   background-image: url("https://ringgeorge.com/wp-content/uploads/2017/07/Handphone-7.jpg")
}
Posted
Updated 15-Nov-18 6:30am
Comments
Member 14065917 24-Nov-18 16:56pm    
Hello,

I haven't been able to find the element in the solution box and CSS is not working. Could you also check my navbar? https://www.medaway.co.uk

1 solution

Against my better judgement I went to the site and found two critical errors that are issues:

1- You do not have an element with a class of "navbar" or "x-navbar"
HTML
<nav id="site-primary-nav">
	 <ul id="site-primary-menu" class="large-nav sf-menu mobile-menu clearfix sf-js-enabled sf-arrows" style="touch-action: pan-y;">
		  <li class="MenuJibberJabber">
		  <a class="sf-with-ul" href="/church/">Church</a><ul class="sub-menu" style="display: none;">
			   <li class="menu-item-277">
			   <a href="/ministries/">Ministries</a></li>
			   <li class="menu-item-278">
			   <a href="/sermons/">Sermon’s</a></li>
		  </ul>
		  </li>
		  <li class="menu-item-21">
		  <a class="sf-with-ul" href="/academy/">Academy</a><ul class="sub-menu" style="display: none;">
			   <li class="page-item-89 menu-item-113">
			   <a href="/">Overview</a></li>
			   <li class="menu-item-115">
			   <a href="/who-we-are/">Who We Are</a></li>
			   <li class="menu-item-114">
			   <a href="/llc-vision/">LLCA Vision</a></li>
			   <li class="menu-item-112">
			   <a href="/llca-mission/">LLCA Mission</a></li>
			   <li class="menu-item-111">
			   <a href="/applicationfees-and-dress-code/">
			   Application,Fees and Dress Code</a></li>
			   <li class="menu-item-110">
			   <a href="/curriculum/">Curriculum</a></li>
		  </ul>
		  </li>
		  <li class="menu-item-47">
		  <a class="sf-with-ul" href="/community-kids-learning-center/">
		  Community Kids Learning Center</a><ul class="sub-menu" style="display: none;">
			   <li class="menu-item-172">
			   <a href="/cklc-page/">CKLC About</a></li>
			   <li class="menu-item-171">
			   <a href="/cklc-hours-and-fees/">CKLC Hours</a></li>
		  </ul>
		  </li>
		  <li class="menu-item-38">
		  <a href="/contact-us/">Contact Us</a></li>
	 </ul>
</nav>

I would try applying that CSS using one of these selectors
CSS
nav {background-image:...}
#site-primary-nav{background-image:...}
#site-primary-menu{background-image:...}


2- The URL for the background image does not resolve.
 
Share this answer
 
Comments
Member 14055926 15-Nov-18 14:26pm    
What does "Not resolve" mean.
Member 14055926 15-Nov-18 14:27pm    
Also i would put the css plus the selector in the custom css part?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900