View Full Version : links in css

11-13-2008, 12:52 PM
I have never done this before, so I dont know if its possible... but can you create a link using css. I have a banner img and I want the img to link back to the news page. I have 25 or so pages so I really cant be bothered going through and linking them by hand.

#banner {background-color:#000000; width:600px; height:100px; background-image:url(logo.png); background-repeat:no-repeat;}

any ideas?

11-13-2008, 01:14 PM
but can you create a link using css. Impossible. CSS is only capable to add some styles to an element, and not capable to add/remove an attribute or an html element.

If you can depend upon some javascript, then it may be possible.

11-13-2008, 01:22 PM
ok thanks for that.. thought as much..

11-13-2008, 06:10 PM
Why not put the image and it's link inside a server side include and include it in every page, then you only have to change the link once.