Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
How to add a link for the image on style css?
Old 11-27-2008, 05:38 PM How to add a link for the image on style css?
Banned

Posts: 9
Name: Hazar
Trades: 0
Hello,

This is the code of a picture on my all html pages which is placed on my style css:

#headermiddleredPan{width:154px; height:154px; background:url(images/xyz.jpg) 0 0 no-repeat; position:absolute; top:14px; left:492px;}

I want to add a link to this image so that users can click the image and go to the website of that link url. How can I do that with the style css sheet? What code should I add to the above code? I also want the link as "blank". The page should open in a new window.

Thanks.
SM911 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-27-2008, 05:55 PM Re: How to add a link for the image on style css?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You can't.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-27-2008, 11:51 PM Re: How to add a link for the image on style css?
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 8,936
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
CSS can only be used to tell elements how to display. You can't make a background image an anchor. If you have text over the image, you can make it an anchor; otherwise you'll have to put the image in the HTML, and wrap it within an anchor element. You can, of course, still style the image with CSS. I would advise you to avoid using absolute positioning unless it is absolutely necessary.

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 11-28-2008, 11:23 PM Re: How to add a link for the image on style css?
Skilled Talker

Posts: 91
Name: marshal
Trades: 0
in the html you could make the div click able with JavaScript. But why not but your image in your html and link from there.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
walkingbird is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to add a link for the image on style css?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19777 seconds with 12 queries