Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transparent backgrounds on a Web page

Status
Not open for further replies.

tmryan

Programmer
Dec 22, 2000
73
US
I have an image file (jpg) that I'm using as a background for a Web-page. The image is an oval picture - yet like all images it displays on a rectangular background (white).
How can I make the white background transparent - so that it picks up the background color of the page?

Is this done with the image? Is it an attribute of the img tag?

Thanks
Tim Ryan
 
You should make the background transparent with your paint program either corel or adobe allow this setting.
 
It also has to be gif - jpg does not support transparency.
If it is anti-aliased, which it needs to be probably since it is not a square - then when you make your image, make sure you hava it on the same background color as your page, so the antialiasing matches.

i.e. On the image - the color you choose for transparent should be the same as the color it will have as a background.
b2 - benbiddington@surf4nix.com
 
If your image is a photograph you might not want to display it as a gif, so what you can do is change the white background of that photo, in Photoshop for instance, to the exact color of your webpage background -use a color picker, and you'll have the value of the color displayed. Then you can use that value when you change the color of the background image (select the white bkground color on the image, then go to edit and fill the selection with the web page bck color. If the transition is too harsh, first apply a feather to your selection. This is all done in photoshop)
 
This almost never works - except with colors like black or white.
b2 - benbiddington@surf4nix.com
 
If you are using Microsoft FrontPage you can make the white transparent with the click of a button. With the image selected click the transparency button and select the white on the image in question - DONE! It will even convert the image to GIF for you.

» » » » » »
Mike Barone
FREE and Pro CGI/Perl Scripts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top