Go Back   SitePoint Forums > Forum Index > Design Your Site > Graphics
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Feb 29, 2004, 18:16   #1
xiaohai
SitePoint Enthusiast
 
xiaohai's Avatar
 
Join Date: Apr 2003
Location: NE
Posts: 75
creating transparent background

Hi,
I'm trying to create a half transparent background effect similar to this website. As what I understand, what he does was setting the "content" class as transparent and tile it with a image. However when I'm trying to create a transparent image like this in photoshop and put it on my website, the background image didn't go through these tiles and become visible. Can anyone tell me if there's a specific way to create these transparent image titles or there's something wrong with my css? Thanks.
__________________
::www.xiaohai.net:: -- No Moose in China
xiaohai is offline   Reply With Quote
Old Feb 29, 2004, 20:03   #2
K. Wolfe
SitePoint Wizard
 
K. Wolfe's Avatar
 
Join Date: Nov 2003
Location: Youngstown, OH
Posts: 1,031
this is what I found in his choco.css file:

Code:
.blogposts {
	float: left;
	margin: 0 10px 0 0;
	padding: 0 0 0 10px;
	border-left: 1px solid #996;
	width: 394px;
	text-align: left;
                font: 75%/175% lucida grande, verdana, arial, helvetica, sans-serif;
	background: transparent url(/choco/trans.gif);
	color: #656633;
	}

.blogposts img {
	margin: 0;
	padding: 10px;
                background: transparent url(/choco/ffctrans.gif);
	color: #464215;
	border: 1px solid #B6B484;
                }
__________________

Kyle Wolfe
K. Wolfe is offline   Reply With Quote
Old Feb 29, 2004, 20:15   #3
mmj
Test cases complete. 0 fails.
 
mmj's Avatar
 
Join Date: Feb 2001
Location: Melbourne Australia
Posts: 6,568
Didja notice the translucent link on her site? Says exactly how she did it right there.
__________________
[mmj] My momentous journey
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Bit Depth Blog · Twitter · Contact me
Spuds Jokes Bazaar VCS Inkscape Firefox phpBB
mmj is online now   Reply With Quote
Old Feb 29, 2004, 20:18   #4
cade
SitePoint Member
 
Join Date: Jul 2003
Location: Green Bay, WI
Posts: 14
Wow, that is a pretty inventive way to use a gif to simulate transparency. Can't wait until there is full support for png and standardized css in IE.
__________________
Personal Site
Artdojo - side project
cade is offline   Reply With Quote
Old Feb 29, 2004, 20:32   #5
mmj
Test cases complete. 0 fails.
 
mmj's Avatar
 
Join Date: Feb 2001
Location: Melbourne Australia
Posts: 6,568
Yep. They are using a pattern like this:

O_
_O

However, it may look smoother on most monitors with a pattern like this:

O_
__________________
[mmj] My momentous journey
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Bit Depth Blog · Twitter · Contact me
Spuds Jokes Bazaar VCS Inkscape Firefox phpBB
mmj is online now   Reply With Quote
Old Feb 29, 2004, 21:51   #6
xiaohai
SitePoint Enthusiast
 
xiaohai's Avatar
 
Join Date: Apr 2003
Location: NE
Posts: 75
oopsy...didn't realize that. Thanks, everyone
__________________
::www.xiaohai.net:: -- No Moose in China
xiaohai is offline   Reply With Quote
Old Mar 1, 2004, 06:06   #7
mistafeesh
SitePoint Enthusiast
 
mistafeesh's Avatar
 
Join Date: Sep 2002
Posts: 42
more about that kind of stuff here. Doesn't work too well in IE tho
__________________
we are all in the gutter, but some of us are looking at the stars
mistafeesh is offline   Reply With Quote
Old Mar 1, 2004, 16:21   #8
neodur
SitePoint Zealot
 
Join Date: Sep 2003
Location: NY
Posts: 141
Alpha (opacity) is now supported by both major browsers i.e. MSIE6.0 and Mozilla/Firefox.

For example the following CSS code added to an image will make it translucent by 50% is both browsers:

Code:
-moz-opacity:0.5;
filter: Alpha(opacity='50');
__________________
h.d.c » myworld | about | works | photolife | asknauroze
neodur is offline   Reply With Quote
Old Mar 1, 2004, 17:14   #9
jtresidder
SitePoint Addict
 
jtresidder's Avatar
 
Join Date: Nov 2003
Location: Southampton, UK
Posts: 345
I was just about to pop into this forum and ask advice about this subject, when I noticed the title of this thread on the front page. Quickest response ever at minus 1 day! Thanks all. (I went with the GIF trick in the end, if anyone's interested)
jtresidder is offline   Reply With Quote
Old Mar 1, 2004, 17:22   #10
jamesxv7
Starting to-digg-in *********
 
jamesxv7's Avatar
 
Join Date: Oct 2003
Location: Island of Puerto Rico @ the Caribbean
Posts: 874
Quote:
Originally Posted by mmj
Yep. They are using a pattern like this:

O_
_O

However, it may look smoother on most monitors with a pattern like this:

O_
Great tip! From now, I will going to use it a lot!
__________________
James: Ecodig - My Blog - My Gallery
Validate your sites: CSS - HTML/XHTML
Without faith you are lost.
jamesxv7 is offline   Reply With Quote
Old Mar 2, 2004, 18:57   #11
K. Wolfe
SitePoint Wizard
 
K. Wolfe's Avatar
 
Join Date: Nov 2003
Location: Youngstown, OH
Posts: 1,031
I think I could use this with a couple designs I already have, especially the one I am working on for a local sports update type thing.
__________________

Kyle Wolfe
K. Wolfe is offline   Reply With Quote
Old Mar 3, 2004, 00:15   #12
wildsue
SitePoint Enthusiast
 
wildsue's Avatar
 
Join Date: Oct 2003
Location: Switzerland
Posts: 44
Lightbulb

What a pity! I wanted to do a similar thing for my website and didn't find the solution. Now I can use it for the next redesign. Thanks a lot!
wildsue is offline   Reply With Quote
Old Mar 3, 2004, 01:12   #13
Si
Also available in Large
 
Si's Avatar
 
Join Date: Sep 2002
Location: Walsall, UK
Posts: 1,943
I've seen the 2x2 px graphic method used before (possibly on an old Microsoft minisite a while back) and thought it was a nice quick fix. I then started using the CSS opacity properties on digidiet and several intranet projects (can't share the links unfortunately). The CSS option is much clearer although obviously has the standards issue on its back.

The only problem I've noticed with the 2x2 px graphics is it causes havoc on my TFT monitor at work! When I first saw the samples on wannabegirl, I thought they were animated. They looked like the snow effect you get on a TV. Saying that, the percentage of non-IE/non-Mozilla browsers which can't render the CSS option is probably less than the percentage of TFT/chunky monitors so its one of those decisions.
__________________
Si
Are you a Photoshop Jedi Master? Prove it!

Is funky house your bag? You'll love this!

Voice
, eyes, ears, body and hands.

Si is offline   Reply With Quote
Old Mar 3, 2004, 03:40   #14
BjarneDM
SitePoint Member
 
BjarneDM's Avatar
 
Join Date: Mar 2004
Location: København ; Danmark
Posts: 1
-khtml-opacity

Quote:
Originally Posted by neodur
Alpha (opacity) is now supported by both major browsers i.e. MSIE6.0 and Mozilla/Firefox.

For example the following CSS code added to an image will make it translucent by 50% is both browsers:

Code:
-moz-opacity:0.5;
filter: Alpha(opacity='50');
The khtml rendering engine has recently gotten -khtml-opacity (http://weblogs.mozillazine.org/hyatt...s/2003_10.html) so that means that Safari has this since v1.1 and that it'll eventually appear in konqueror.

Eventually, we'll get CSS3
BjarneDM is offline   Reply With Quote
Old Mar 3, 2004, 10:26   #15
tentonjim
SitePoint Enthusiast
 
tentonjim's Avatar
 
Join Date: Aug 2003
Location: Jacksonville, Florida USA
Posts: 82
Quote:
Originally Posted by neodur
Alpha (opacity) is now supported by both major browsers i.e. MSIE6.0 and Mozilla/Firefox.

For example the following CSS code added to an image will make it translucent by 50% is both browsers:

Code:
-moz-opacity:0.5;
filter: Alpha(opacity='50');
Will either of these validate?
Thanks...

I have done the gif trick too http://freecfm.com/t/tentonhead/index.cfm?lite=home

right click (in a gecko) and "view background image", then save it, then change the color in Photoshop if you want. It's about 20x20 so it is easy to work with.
tentonjim is offline   Reply With Quote
Old Mar 3, 2004, 20:50   #16
neodur
SitePoint Zealot
 
Join Date: Sep 2003
Location: NY
Posts: 141
Quote:
Originally Posted by tentonjim
Will either of these validate?
Currently, no. But in the future when the next version of CSS comes out, we will simply have 'opacity', and hopefully Microsoft with add that to their engine regardless of whether they keep or discard their proprietary filters.
__________________
h.d.c » myworld | about | works | photolife | asknauroze
neodur is offline   Reply With Quote
Old Mar 3, 2004, 23:09   #17
wildsue
SitePoint Enthusiast
 
wildsue's Avatar
 
Join Date: Oct 2003
Location: Switzerland
Posts: 44
I tried out both methods: the one with 2 dots in 2x2px square and the other one with only one dot at the upper side. Both look fine, but the effect is rather different. First is much more intense (like a curtain) than the other who looks lighter. Perhaps usable for two "over-layers", with changing the dot to downside? Has anyone played a bit with that?
The css-methods of opacity are not usable as long as not all browsers do the same thing with it - thats my opinion...
wildsue is offline   Reply With Quote
Old Mar 4, 2004, 16:36   #18
jtresidder
SitePoint Addict
 
jtresidder's Avatar
 
Join Date: Nov 2003
Location: Southampton, UK
Posts: 345
Quote:
Originally Posted by tentonjim
I have done the gif trick too http://freecfm.com/t/tentonhead/index.cfm?lite=home
right click (in a gecko) and "view background image", then save it, then change the color in Photoshop if you want. It's about 20x20 so it is easy to work with.
Quick tip for you all: A background image that has to tile a lot to cover the area it's supposed to will slow down some browsers, especially when scrolling the page. You can see the effect by tiling a small image across the background of a large table contain lots of linebreak tags (Try it, you'll be suprised!).

The optimum size for a background image should weigh this against increased file size. Personally I use around 100x100 images, as they add so little filesize. My checkerboard transparency gif is 100x100 to eliminate the slowdown, and still weighs in at under 1/2k.
jtresidder is offline   Reply With Quote
Old Mar 8, 2004, 18:34   #19
Arctic Fox
SitePoint Member
 
Join Date: Mar 2004
Location: Murmansk, Arctic
Posts: 8
One could always 'fake' a transparency by using 2 images. I've done this on my site for it to be cross-browser viewable in IE5.0

http://arctic.ithium.net/
Arctic Fox is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

 
Forum Jump


All times are GMT -7. The time now is 21:10.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved