Help - Search - Members - Calendar
Full Version: background (url) questions
HTMLHelp Forums > Web Authoring > Cascading Style Sheets
BouncerFL
Hi all,

Please forgive my likely *very* newbie style question, but I've read all I can on this issue and can't seem to find the answer.

On http://campleah.swhi.net/index2.html, there's an image at the bottom right of the screen being called by this CSS line (in ./style.css)

#contain {

width:950px;
border-right:5px solid #000000;
border-left:5px solid #000000;
margin-left:auto;
margin-right:auto;
background: #FFF url('sun.gif') bottom right no-repeat;
}

Is there a way to get that image to be about 55% opaque?

This is a modification of an oswd.org design and I'm really having difficulty grasping some of the CSS therein. Again, my apologies, but I'm an admitted uber-newbie at this.

Thanks!

BouncerFL
~Ray
jimlongo
try these for tips . . .

http://www.mandarindesign.com/opacity.html
http://www.quirksmode.org/css/opacity.html
BouncerFL
Jim,

I looked there prior to posting. My question, I guess, involves syntax and/or code placement. As I want the opacity value to apply to the image which is referred to in:

QUOTE
background: #FFF url('sun.gif') bottom right no-repeat;

Where would I put the

opacity: .2;

statement? When I try that as a line unto itself under the line above, no visible change occurs.

Again, my apologies for what's likely a dumb-@#$ question smile.gif

~Ray
jimlongo
i haven't read those pages closely, but I don't know if you can apply the opacity to a background image?

Christian J
True, opacity applies to HTML elements so text in front of the background image will become semi-transparent as well. If the BODY background is a solid color you can fake opacity in the image file. Otherwise (if the BODY background is an image too) you might use an inline image (with opacity) and position the other content in front of it with CSS. Or you might use a PNG image with alpha transparency, but the workarounds for IE6 are complicated.


BouncerFL
QUOTE(Christian J @ Oct 19 2006, 01:55 PM) *

True, opacity applies to HTML elements so text in front of the background image will become semi-transparent as well. If the BODY background is a solid color you can fake opacity in the image file. Otherwise (if the BODY background is an image too) you might use an inline image (with opacity) and position the other content in front of it with CSS. Or you might use a PNG image with alpha transparency, but the workarounds for IE6 are complicated.


Thanks, Christian. I figured I'd probably need an in-line image there but was hoping not to muck too much with the layout by hand as I'm very inexperienced and didn't want to bollocks it up fully smile.gif

I truly appreciate the lessons learned and the gracious help from this board!

Regards,
~Ray
pandy
Since the only thing you would see through the semi transparent background image is the page background, you could as well modify the image file (blend it to the background color). unsure.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.