Shared publicly  - 
 
Want to learn the most kickass JavaScript framework ever? Here are some tutorials.
10
6
Steve Garf's profile photoPeter Elst's profile photoMichael Svendsen's profile photoGabriele Giannotti's profile photo
9 comments
 
dear jason how i can write in my text css opacity for bg
regards cesare casadonte
 
+cesare casadonte I am not sure I follow. You wish to make an image have opacity? In which case you can do $('#imageId').css("opacity", "0.4");
 
I just started learning dart, don't confuse me with these sorcery ^^
 
You would have to use CSS3. Check browser support:

$("#elementID").css("background-color", "rgba(255,0,0,0.5)");
 
it should do on later versions. If you cant use the above due to not running an up to date browser then you will have to hack it. Eg having a div element that is positioned absolute inside its container that is positioned relative.

For example:


<div id="myBackground" style="position:relative; width:100px;height:100px; background-color:#ff0000;">

<div class="fakeOpacity" style="background-color:#00ff00; position:absolute; top:0; bottom:0; left:0; right:0; opacity:0.5"></div>

</div>

you could then use:

$('.fakeOpacity').css('opacity', '0.3');

Of course in this case you must insure this div element is the lowest so all other elements are on top.
 
thanks jason you are a great friend regards cesare casadonte
Add a comment...