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
CSS image to link to website.
Old 02-19-2011, 12:54 PM CSS image to link to website.
Extreme Talker

Posts: 193
Name: Adam Moseley
Trades: 0
I have the following CSS code on my site;

Code:
{
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 600px;
  height: 290px;
  background-image: url('images/header.png');
  background-repeat: no-repeat;
  background-position: center center;
}
What code do I need to add to link this image to a certain web address?
__________________

Please login or register to view this content. Registration is FREE
aadam is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-19-2011, 02:00 PM Re: CSS image to link to website.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You can't.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is 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 03-03-2011, 04:57 AM Re: CSS image to link to website.
Novice Talker

Posts: 8
Name: Sam
Trades: 0
Quote:
Originally Posted by aadam View Post
I have the following CSS code on my site;

Code:
{
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 600px;
  height: 290px;
  background-image: url('images/header.png');
  background-repeat: no-repeat;
  background-position: center center;
}
What code do I need to add to link this image to a certain web address?

If I am getting what exactly you want is to create an image link but the image is added in the background of webpage, so you can use anchor map option which helps to define the coordinates on the webpage to link with a web address ... hope this work for you ...
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
samlko is offline
Reply With Quote
View Public Profile
 
Old 05-26-2011, 04:51 AM Re: CSS image to link to website.
Junior Talker

Posts: 4
Trades: 0
Your code is for the styling not for the anchor
georga is offline
Reply With Quote
View Public Profile
 
Old 05-30-2011, 12:22 AM Re: CSS image to link to website.
Experienced Talker

Posts: 39
Name: Day
Trades: 0
First add this to your css so visitors will know it is a link

Code:
 #example {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 600px;
  height: 290px;
  background-image: url('images/header.png');
  background-repeat: no-repeat;
  background-position: center center;
  cursor: pointer;
}
then in your html :

HTML Code:
<div id="example" onclick="window.open('http://www.link.com')"></div>

Last edited by DayliDesign; 05-30-2011 at 12:23 AM..
DayliDesign is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to CSS image to link to website.
 

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 2.09585 seconds with 12 queries