1180 posts
  • Affiliate Level 5
  • Author Level 5
  • Collector Level 2
  • Exclusive Author
+2 more
mabuc
says

Hello guys,

I have a simple problem.. how can I make the background image opacity that does not affect the child element.. below are my code on this..

CSS
.menu ul li.nav-home { background:url('img/icons/home.png') no-repeat center 6px; opacity:0.2; }
HTML
<div class="menu">
<ul>
<li class="nav-home"><a href="#">Home</a></li>
</ul>  
</div> 

this is wp_nav_menu for WordPress.. I google this but still not working maybe you have an idea..

thanks

243 posts
  • 6 Years of Membership
  • Affiliate Level 1
  • Author Level 3
  • Weekly Top Seller
creativestuff
says

have you tried

.menu ul li.nav-home { background:url(‘img/icons/home.png’) no-repeat center 6px; opacity:0.2; }

+

.menu ul li.nav-home a{ opacity:1; }

1180 posts
  • Affiliate Level 5
  • Author Level 5
  • Collector Level 2
  • Exclusive Author
+2 more
mabuc
says

have you tried

.menu ul li.nav-home { background:url(‘img/icons/home.png’) no-repeat center 6px; opacity:0.2; }

+

.menu ul li.nav-home a{ opacity:1; }

Yes.. that will not work..

1034 posts
  • Author Level 3
  • Beta Tester
  • Collector Level 1
  • Exclusive Author
+2 more
BenSheppard
says

Yeah, it won’t work as everything in the <ui> becomes opacity 0.2



use rgba eg, (255, 255, 255, 0.6) will be like opacity 0.6 on a white background. This changes the color and not the actual transparency, this doesn’t work in IE7 but there is a fix online! :)

1180 posts
  • Affiliate Level 5
  • Author Level 5
  • Collector Level 2
  • Exclusive Author
+2 more
mabuc
says

This is not working also.. Seems I cannot solve this one.. here’s my new question.. How do I add extra span tag in my wp_nav_menu function?

<div class="menu">
<ul>
<li class="nav-home"><span> </span><a href="#">Home</a></li>
</ul>  
</div> 
by
by
by
by
by
by