View Full Version : Using CSS to link background image HELP
kotun
03-02-2005, 11:01 PM
I am trying to link my background image which is called using the background url method in a css...but can I use the background as a link to a webpage using this css method?
I tried looking on it on the net but nothing...or do you have a better suggestion?
BaldEagle
03-27-2005, 10:41 PM
I do not believe you can do this, and I don't really understand your need to. Is your image small and set in the middle of your page or is it full screen? Doesn't any content cover it? If you have arranged your page to keep all your content away from your background image then do away with the background image and either use a table to encapsulate it or wrap it in a div then use an anchor to make it a link.
You can set the image as a background for a table cell, then create a 1x1 blank transparent gif. Put the blank gif in the cell using the same dimensions for the gif as you have for the table cell. Wrap that image in an anchor. Same for the div method also.
Of course these methods do not allow the image to function as a watermark. It will scroll with the rest of the page. If this is not an option then you will have to come up with something different.
BaldEagle
kotun
03-30-2005, 10:57 PM
Hi,
Many thanks for the information.
The reason I wanted to use the background image is that I am using a div tag to place a background image on the header (which has a title). This will be used on all webpages, where I only change the title and use the style sheet to take care of the background image...minimising code in the file.
Now, I am thinking of adding a link so that the background image can act as a banner...so that I can easily control the banner using only one file (the css).
I have tried looking for answers, but I guess this is something the people who is creating our reference codes may need to look into for improvement in the future :)
Regards.
Ps. do you happen to code PHP-MySQL? I need help here...one for my ex-school (as charity) and the other for a company that I am thinking to start...or if you have friends who can be trusted in doing a fine job....email me at ko_tun_kwan@hotmail.com........many many thanks!
vBulletin v3.0.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.