Jump to content


CSS Opacity trouble....


10 replies to this topic

#1 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 12 December 2005 - 09:03 AM

Hey all, working on designing my new portfolio website in CSS, and trying to make it XHTML 1.1 compatible, so lotsa div's for me! Anyways, trying to get one div to be semi-transparent, but now everything I put in that div is transparent...and I want the text and pics to be 100% opacity, rather than the 50% that the div is set to. I've tried using a transparent png or gif to get the same result that I wanted, but those didnt work. The only other option I can think of is using absolute positioning, but that isnt all too cross-browser freindly.
#cntright{
	height:355px;
	width:130px;
	border: solid 1px;
	margin: 10px, 10px, 10px, 5px;
	background: #348a43;
	filter: alpha(Opacity=50);
	text-align:left;
	}
That is what the CSS for that portion looks like. If anyone can give me some help, it would really be appreciated. Basically, what im trying to do is have the background on the div below to appear through the upper one, but not dim the text or make the images within that div, or divs within the div, become transparent.

Thanks all

#2 HaloprO

    Requires Armed Escort

  • Members
  • PipPip
  • 310 posts
  • Gender:Male
  • Location:California, USA

Posted 12 December 2005 - 03:25 PM

#cntright {
	height:355px;
	width:130px;
	border: solid 1px;
	margin: 10px, 10px, 10px, 5px;
	background: #348a43;
	filter: alpha(Opacity=50);
	text-align:left;
}
Do that, and add another <div> layer in #cntright and give it a new id, like "non-opaque"
#non-opaque {
		filter: alpha(Opacity=100);
}


#3 d7x

    P2L Jedi

  • Twodded Staff
  • PipPipPip
  • 586 posts
  • Gender:Male
  • Location:Virginia
  • Interests:Life

Posted 12 December 2005 - 04:08 PM

look dont use opacity with css. half the browsers out there dont even support it. so half the ppl will be looking at a website without the transparency

#4 HaloprO

    Requires Armed Escort

  • Members
  • PipPip
  • 310 posts
  • Gender:Male
  • Location:California, USA

Posted 12 December 2005 - 05:31 PM

All browser suppport it, you just have to know what you are doing :unsure:

#5 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 12 December 2005 - 06:43 PM

im sure that won't validate as it's not real css.

#6 -Michael-

    P2L Jedi

  • Members
  • PipPipPip
  • 737 posts
  • Gender:Male
  • Location:Florida

Posted 12 December 2005 - 07:12 PM

The only browser I know of that supports it anyway is IE.

#7 Wybe

    Jedi In Training

  • Members
  • PipPip
  • 399 posts
  • Gender:Male
  • Location:the Netherlands
  • Interests:Graphic design, digital and traditional, street style, graffiti, guerilla drawing, typography, coding, sex

Posted 13 December 2005 - 02:09 AM

Oh I figured IE would probably be the only one to *not* support it :P IE5 also?

#8 d7x

    P2L Jedi

  • Twodded Staff
  • PipPipPip
  • 586 posts
  • Gender:Male
  • Location:Virginia
  • Interests:Life

Posted 13 December 2005 - 06:42 AM

Opera does not support CSS Opacity ive tried every way to use opacity with opera and it doesnt work... + it isnt vaild. One 2 browsers i know that support it is firefox and IE.

#9 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 13 December 2005 - 10:37 AM

Is there any other way to get the desired effect without using opacity in css?

Posted Image

Thats the general idea of what the website should look like. I want the text area and the recent work section to be transparent.

Edited by Pax, 13 December 2005 - 11:25 AM.


#10 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 13 December 2005 - 05:15 PM

If it's going to be fixed width, you can just use a background image.
A liquid template could also work, but the lines might not match up exactly when repeating.

Edited by rc69, 13 December 2005 - 05:16 PM.


#11 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 13 December 2005 - 08:12 PM

Thanks, rc69, that should work great!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users