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
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> 

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by