Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1679 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

Background Transparency with Opaque Text

Thread title: Background Transparency with Opaque Text
Reply    
    Thread tools Search this thread Display Modes  
10-20-2010, 02:29 PM
#1
RedStar is offline RedStar
Status: I'm new around here
Join date: Oct 2010
Location: Detroit, MI
Expertise:
Software:
 
Posts: 13
iTrader: 0 / 0%
 

RedStar is on a distinguished road

  Old  Background Transparency with Opaque Text

I tried searching for a similar thread, but was unable to find anything.

I'm trying to make the backgrounds of my content divs 70% transparent using the following:

.transparency {
filter:alpha(opacity=70);
-moz-opacity:0.7;
-khtml-opacity: 0.7;
opacity: 0.7;
}

Unfortunately, this is also making the content within those divs use the same opacity. I tried nesting another div inside using the following:

.opaque-text {
filter: alpha(opacity=100);
-moz-opacity: 1.0;
-khtml-opacity: 1.0;
opacity: 1.0;
position: relative;
z-index: 2;
}

But it does not seem to be working. I feel like this should be a simple fix, and I'm missing something obvious. I know I can always use a .png as a background image, but I'm trying to do this in pure CSS if at all possible.

Thanks!

12-08-2010, 05:15 AM
#2
Morning is offline Morning
Status: Junior Member
Join date: Nov 2010
Location: Alabama, USA
Expertise: web design, writing, proofread
Software: HomeSite, Paint Shop Pro
 
Posts: 50
iTrader: 0 / 0%
 

Morning is an unknown quantity at this point

  Old

You can't do it as a child element. You will have to set the text outside the transparent part, and use something like absolute positioning or negative margins to get it inside. See this page for more information: http://css-tricks.com/non-transparen...rent-elements/

12-08-2010, 12:14 PM
#3
RedStar is offline RedStar
Status: I'm new around here
Join date: Oct 2010
Location: Detroit, MI
Expertise:
Software:
 
Posts: 13
iTrader: 0 / 0%
 

RedStar is on a distinguished road

  Old

Wow, thanks for the response Morning! I hadn't found that article when I was searching for this.

Reply With Quote
Reply    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed