I have this div which has transparency set to 40%.
The problem is that the rest of the divs inherit this tranparency, so I get a transparent background and transparent text.
How can I get a transparent background color but not transparent text? (the text is placed on a div box with a background color)
Heres the code (tranparrent stuff highlighted):
HTML:
CSS:HTML Code:<div id="content"> <div class="post"> <h2 class="title"><a href="#">Welcome to Inscriptions</a></h2> <p class="meta"><span class="date">November 10, 2010</span><span class="posted">Posted by <a href="#">Someone</a></span></p> <div style="clear: both;"> </div> <div class="entry"> <p>This is <strong>Inscriptions </strong>, a free, fully standards-compliant CSS template designed by FreeCssTemplates<a href="http://www.nodethirtythree.com/"></a> for <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>. This free template is released under a <a href="http://creativecommons.org/licenses/by/2.5/">Creative Commons Attributions 2.5</a> license, so you’re pretty much free to do whatever you want with it (even use it commercially) provided you keep the links in the footer intact. Aside from that, have fun with it :)</p> <p>Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum ipsum. Proin imperdiet est. Phasellus dapibus semper urna. Pellentesque ornare, orci in felis. Donec ut ante. In id eros. Suspendisse lacus turpis, cursus egestas at sem.</p> <p class="links"><a href="#">Read More</a> | <a href="#">Comments</a></p> </div> </div> <div class="post"> <h2 class="title"><a href="#">Lorem ipsum sed aliquam</a></h2> <p class="meta"><span class="date">November 10, 2010</span><span class="posted">Posted by <a href="#">Someone</a></span></p> <div style="clear: both;"> </div> <div class="entry"> <p>Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer. Donec ipsum. Proin imperdiet est. Phasellus <a href="#">dapibus semper urna</a>. Pellentesque ornare, orci in consectetuer hendrerit, urna elit eleifend nunc, ut consectetuer nisl felis ac diam. Etiam non felis. Donec ut ante. In id eros. Suspendisse lacus turpis, cursus egestas at sem. Mauris quam enim, molestie in, rhoncus ut, lobortis a, est.</p> <p class="links"><a href="#">Read More</a> | <a href="#">Comments</a></p> </div> </div> <div class="post"> <h2 class="title"><a href="#">Consecteteur hendrerit </a></h2> <p class="meta"><span class="date">November 10, 2010</span><span class="posted">Posted by <a href="#">Someone</a></span></p> <div style="clear: both;"> </div> <div class="entry"> <p>Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer. Donec ipsum. Proin imperdiet est. Phasellus <a href="#">dapibus semper urna</a>. Pellentesque ornare, orci in consectetuer hendrerit, urna elit eleifend nunc, ut consectetuer nisl felis ac diam. Etiam non felis. Donec ut ante. In id eros. Suspendisse lacus turpis, cursus egestas at sem. Mauris quam enim, molestie in, rhoncus ut, lobortis a, est.</p> <p class="links"><a href="#">Read More</a> | <a href="#">Comments</a></p> </div> </div> <div class="post"> <h2 class="title"><a href="#">Suspendisse hendrerit </a></h2> <p class="meta"><span class="date">November 10, 2010</span><span class="posted">Posted by <a href="#">Someone</a></span></p> <div style="clear: both;"> </div> <div class="entry"> <p>Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer. Donec ipsum. Proin imperdiet est. Phasellus <a href="#">dapibus semper urna</a>. Pellentesque ornare, orci in consectetuer hendrerit, urna elit eleifend nunc, ut consectetuer nisl felis ac diam. Etiam non felis. Donec ut ante. In id eros. Suspendisse lacus turpis, cursus egestas at sem. Mauris quam enim, molestie in, rhoncus ut, lobortis a, est.</p> <p class="links"><a href="#">Read More</a> | <a href="#">Comments</a></p> </div> </div> <div style="clear: both;"> </div> </div>
Code:/* Content */ #content { float: right; width: 520px; padding: 70px 30px 0px 60px; border: 1px solid #575555; background: #454545;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; -moz-opacity:0.4; -khtml-opacity: 0.4; opacity: 0.4;} .post { margin-bottom: 40px; } .title { padding: 0px 0px 10px 0px; text-transform: lowercase; font-family: Georgia, "Times New Roman", Times, serif; letter-spacing: -.5px; } .post .title a { color: #79350A; } .post .meta { overflow: hidden; background: #EDE8CA; margin-bottom: 30px; padding: 5px 10px 5px 10px; text-align: left; font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-weight: bold; } .post .meta .date { float: left; } .post .meta .posted { float: right; } .post .entry { padding: 0px 0px 20px 0px; border-bottom: 1px dashed #DCD4A7; text-align: justify; }



Reply With Quote



Bookmarks