Forum Moderators: not2easy

Message Too Old, No Replies

How to Link background-image to home page in CSS

link background-image to home page

         

qman2002

6:47 pm on Aug 23, 2006 (gmt 0)

10+ Year Member



I am a newbie to css so please forgive me if this is an obvious question. I would like to have my background-image(which is my header image) link back to my home page. All I have seen is the url tag which is where I had to put the location of my image.

Any help gladly appreciated. Thanks in advance.

Setek

2:24 am on Aug 24, 2006 (gmt 0)

10+ Year Member



There's no way to make an anchor in CSS - that's not the point and function of CSS.

CSS is about separating presentation from markup, and keeping the markup semantic.

If you want a header div that has a background image to link back to home, use an onclick event.

Better yet, for proper, semantic markup, don't put the background image on the header div - have an anchor inside with the header text, set it to display block, and put the background image to -that- instead.

It's better for "degrading gracefully" :)