473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Making a background image a working link

I'm using a stylesheet to place a small 'background image' in the
upper left corner of several pages. Is there a simple way of making
that image a clickable link? Thanks.
Jul 20 '05 #1
14 35500
Jeff Gillingham wrote on 30 nov 2003 in
comp.infosystems.www.authoring.stylesheets:
I'm using a stylesheet to place a small 'background image' in the
upper left corner of several pages. Is there a simple way of making
that image a clickable link? Thanks.


A background image is not clickable, onmy html-elements are clickable and
if the background image is a style of the body, only the body is.

However you can make a position absolute transparent div with a z-index of
say 9999 overlaying the bg img and all other elements and make that
clickable:
<body style="background-image:url('myimage.gif');
background-repeat:no-repeat;background-position:left top;">
<div
style="position:absolute;left:0;top:0;z-index:9999;
background-color:transparent;width:350px;height:250px;"
onclick ="whatever()">&nbsp;</div>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2
Jeff Gillingham wrote:
I'm using a stylesheet to place a small 'background image' in the
upper left corner of several pages. Is there a simple way of making
that image a clickable link?


If its clickable then it should be a foreground image with suitable
alternative text. Backgrounds are for presentation only.
Jul 20 '05 #3
Evertjan. wrote:
Jeff Gillingham wrote on 30 nov 2003 in
comp.infosystems.www.authoring.stylesheets:

I'm using a stylesheet to place a small 'background image' in the
upper left corner of several pages. Is there a simple way of making
that image a clickable link? Thanks.

A background image is not clickable, onmy html-elements are clickable and
if the background image is a style of the body, only the body is.

However you can make a position absolute transparent div with a z-index of
say 9999 overlaying the bg img and all other elements and make that
clickable:
<body style="background-image:url('myimage.gif');
background-repeat:no-repeat;background-position:left top;">
<div
style="position:absolute;left:0;top:0;z-index:9999;
background-color:transparent;width:350px;height:250px;"
onclick ="whatever()">&nbsp;</div>

quite clever.

--
Bill Drescher
bill {at} TechServSys {dot} com

Jul 20 '05 #4
bill drescher wrote:
A background image is not clickable, onmy html-elements are clickable and
if the background image is a style of the body, only the body is.

However you can make a position absolute transparent div with a z-index
of say 9999 overlaying the bg img and all other elements and make that
clickable:
quite clever.


Until you try using it in a browser which does not support, or has turned
off, either images, CSS or both.
Jul 20 '05 #5
David Dorward wrote on 01 dec 2003 in
comp.infosystems.www.authoring.stylesheets:
quite clever.


Until you try using it in a browser which does not support, or has
turned off, either images, CSS or both.


I do not think it was that clever, but the cleverness of a code does not
change if you try that.

btw:

It is damn stupid to try that without accepting that it hurts your
functionality. Try to look at such a page with the computer turned off.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #6
Evertjan. wrote:
David Dorward wrote on 01 dec 2003 in
comp.infosystems.www.authoring.stylesheets:
Until you try using it in a browser which does not support, or has
turned off, either images, CSS or both.


btw:

It is damn stupid to try that without accepting that it hurts your
functionality. Try to look at such a page with the computer turned off.


Is it damn stupid to browse with Lynx? Is Googlebot damn stupid to
spider the www?

--
Brian
follow the directions in my address to email me

Jul 20 '05 #7
Brian wrote on 01 dec 2003 in comp.infosystems.www.authoring.stylesheets:
Evertjan. wrote:
David Dorward wrote on 01 dec 2003 in
comp.infosystems.www.authoring.stylesheets:
Until you try using it in a browser which does not support, or has
turned off, either images, CSS or both.
btw:

It is damn stupid to try that without accepting that it hurts your
functionality. Try to look at such a page with the computer turned off.


Is it damn stupid to browse with Lynx?


No, not at all, but I repeat, it is damn stupid to browse with Lynx AND not
accepting the limitations of that.
Is Googlebot damn stupid to spider the www?


Sorry, I don't see the connection. Googlebot only does as it is told.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #8
Evertjan. wrote:
Brian wrote on 01 dec 2003 in comp.infosystems.www.authoring.stylesheets:
Evertjan. wrote:
David Dorward wrote on 01 dec 2003 in
comp.infosystems.www.authoring.stylesheets:

Until you try using it in a browser which does not support, or has
turned off, either images, CSS or both.
It is damn stupid to try that without accepting that it hurts your
functionality. Try to look at such a page with the computer turned off.


Is it damn stupid to browse with Lynx?


No, not at all, but I repeat, it is damn stupid to browse with Lynx AND not
accepting the limitations of that.


The only limitation of Lynx relevant to this discussion is the
inability to display the images inline. Lynx has absolutely no
deficiency when it comes to linking to other resources. That includes
linking images, which Lynx displays either using a placeholder, or the
alt text. A properly authored page would, of course, have alt text
anytime an image is important enough to be linked.

A solution which relies on image loading and css will fail when
browsed by Lynx. A solution that relies instead on floating the
image, and making that a hyperlink, will not fail in Lynx. And it
will work in Mozilla, Opera, et. al., too.
Is Googlebot damn stupid to spider the www?


Sorry, I don't see the connection. Googlebot only does as it is told.


Googlebot does not load images and does not process css. (It also
does not have js, but that's another story.) If a person is "damn
stupid" to browse that way, then I wonder if Googlebot is similarly
deficient.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #9
Evertjan. wrote:
Until you try using it in a browser which does not support, or has
turned off, either images, CSS or both.
It is damn stupid to try that without accepting that it hurts your
functionality.


Do what? Using a browser with out images and/or CSS support?

Plenty of people disable images - especially among those who pay for
bandwidth by data transfered rather then a flat or per $time-period rate.

Plenty of people have disabilities that make them dependent on alt text to
understand images.

Increasing numbers of people are using hand held devices to access the
Internet - and they tend towards having tiny screens and poor CSS support -
both factors that would make the technique being described useless to them.

One of the great things about the web is that webpages (IF the right tool is
used for the right job) is that if you have a flash system (and are
physically capable of using the technologies), you can get pretty, highly
interactive content. If you _don't_ then you can discard layers until you
get to the bits you can enjoy.

Content is king.

Lynx may have its limitations, but if the page is written properly then all
the content will be accessible.

(Insert usual exceptions for movies, gallery sites, and interactive game
applets noting that even in those cases a well written site will still
allow the user to navigate and download content lynx can't display
natively)

--
David Dorward <http://dorward.me.uk/>

Jul 20 '05 #10
Brian wrote on 02 dec 2003 in comp.infosystems.www.authoring.stylesheets:
A solution that relies instead on floating the
image, and making that a hyperlink


Ho ho,

The OQ was not about an hyperlink, just about clickability.

The result of the click is the execution of a javascript [or other] code.

This code could have all kinds of effects not available in Lynks.

But all this is OT [not the OQ], clicking is not part of CSS.

[btw: my longtime experience with Lynx ended in 1996.]
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #11
On Tue, 2 Dec 2003, Evertjan. wrote:
Brian wrote on 02 dec 2003 in comp.infosystems.www.authoring.stylesheets:
A solution that relies instead on floating the
image, and making that a hyperlink
Ho ho,

The OQ was not about an hyperlink, just about clickability.

The result of the click is the execution of a javascript [or other] code.


Or not, depending on the browsing situation. If you're using such
potentially risky techniques in the first place, I'm not sure why
you'd be so keen to add yet more risk factors to them. Making a
useful web page is often about knowing what to leave out, rather than
trying to shovel-in every kind of technology that one can get hold of.
[btw: my longtime experience with Lynx ended in 1996.]


Was that a boast or an apology?

Then maybe you'd do better to defer to those who have at least some
familiarity with its current versions, rather than trying to pour
scorn on their contributions to the discussion.

Jul 20 '05 #12
Evertjan. wrote:
David Dorward wrote on 01 dec 2003 in
comp.infosystems.www.authoring.stylesheets:
quite clever.
Until you try using it in a browser which does not support, or has
turned off, either images, CSS or both.

....
It is damn stupid to try that without accepting that it hurts your
functionality. Try to look at such a page with the computer turned off.

I tried that, and you are right, it did not bring up the page. I guess
that it is reasonable to assume that most folk will have their computer
on and css enabled to see this site. But, the author will have to
accept that he will lose the traffic of those who have css turned off,
images turned off, or their computers turned off.

--
Bill Drescher
bill {at} TechServSys {dot} com

Jul 20 '05 #13
*bill drescher* <no****@Spamcop.net>:

I guess that it is reasonable to assume that most folk will have their
computer on and css enabled to see this site. But, the author will have to
accept that he will lose the traffic of those who have css turned off,
images turned off, or their computers turned off.


Don't forget people with user stylesheets. Some may have (probably one of
the most common UCSS rulesets):

body {background: white !important; color: black !important}

they'll not see the image, but the area would be clickable. Others may hate
fixed positioning and thus specified

* {position: static !important},

because you can't disable only 'position: fixed'. They'll see the image, but
it won't be clickable.

--
If the glass is half full or half empty
depends on if you are pouring or drinking.
Jul 20 '05 #14

I was trying to do something similar. Here's a mickey mouse workaroun
that will do the trick.

Create a transparent graphic in Illustrator or any other graphic
program you have, make sure to save it as GIF.

Dreamweaver lets you make DIV layers easily. Create one over the imag
you're trying to link. Insert your transparent gif and add the url t
it. That's it.

Cheesy. I know, but it works

Unregistered
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
View this thread: http://www.forum4designers.com/message17557.htm

Jul 20 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Chris Beall | last post by:
I'm displaying an image that is also a link against a black background. In Netscape 7.1, the current background color is displayed as a horizontal bar below the image. This allows :hover effects...
27
by: Kevin Yu | last post by:
When I declare on HTML page <LINK href="mycss.css" type="text/css" rel=stylesheet /> .... <BODY class=myclass> in mycss.css BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY:...
2
by: chris_culley | last post by:
Hi there, I've got a gif with (highly) irregular shapes (lots of jigsaw pieces) that I want to map so that each piece is a link... The pieces are currently just a frame drawing, but as they...
1
by: sweep | last post by:
Hi there, I am redeveloping my site to use CSS and have come up against a problem. The page I'm working on is at http://staging.proscenia.co.uk/revised%20simpler%20CSS%20floats%20version.html...
0
by: johkar | last post by:
If you add a background image to a link, the spinning Microsoft logo stops spinning in IE 6 after you click the link and move the mouse off it. Most people never notice this, but in applications...
4
by: tchatchke | last post by:
Hello, New here and having some difficulty getting a back ground image to appear in my html when called from an external CSS. I am working on OS 10.2.something with Dreamweaver 8. I have gone...
2
by: rigiditymodulus | last post by:
Hi - So, I had this working perfectly, then had a small crash (the transmitter for my wireless mouse occassionally freaks out my MacBook Pro) and when I rebooted and opened up my file the two...
16
by: stevedude | last post by:
CSS newbie again. I have a problem trying to get coffee mug images within anchor tags to center with my link text for a vertical list menu. If I use the horizontal/vertical properties of...
10
by: VividWeb | last post by:
Hi. I am relatively new to CSS and HTML but have a basic understanding of most things. One of my backgrounds is not positioning correctly in IE 7 or AOL. The background behind the content...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.