1179 posts
  • Has referred 200+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+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
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Located in Europe
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; }

1179 posts
  • Has referred 200+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+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
  • Has sold $100+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+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! :)

1179 posts
  • Has referred 200+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+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