473,608 Members | 2,410 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 35544
Jeff Gillingham wrote on 30 nov 2003 in
comp.infosystem s.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="backgrou nd-image:url('myim age.gif');
background-repeat:no-repeat;backgrou nd-position:left top;">
<div
style="position :absolute;left: 0;top:0;z-index:9999;
background-color:transpare nt;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.infosystem s.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="backgrou nd-image:url('myim age.gif');
background-repeat:no-repeat;backgrou nd-position:left top;">
<div
style="position :absolute;left: 0;top:0;z-index:9999;
background-color:transpare nt;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.infosystem s.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.infosystem s.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.infosystem s.www.authoring.stylesheets:
Evertjan. wrote:
David Dorward wrote on 01 dec 2003 in
comp.infosystem s.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.infosystem s.www.authoring.stylesheets:
Evertjan. wrote:
David Dorward wrote on 01 dec 2003 in
comp.infosys tems.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
functionalit y. 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

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

Similar topics

5
3473
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 that change the background color to have a visible effect, as this bar changes color. By default, it appears that the color is inherited from the body color, i.e. with no link style applied, the bar is black, and invisible against the background....
27
13568
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: Arial, Geneva; background-image: url(images/back.jpg); }
2
4534
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 are hovered over I want them to be coloured in. I thought the easiest way to do this would be to change the background image of the entire map (since it's a bit of a pain trying to select each piece out of the image and
1
2164
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 and the stylesheet at http://staging.proscenia.co.uk/projectpage.css To create the navigation bar, I have styled the <A> tags to use a background image and text positioning to create a scalable button look (previously these were all pre-generated...
0
1263
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 where there is a slight delay before going to the next page, the logo stops spinning and the progress bar stops working if you mouse off the link. I am using the "sliding doors" technique to add rounded corners to tabs. I have been unable to...
4
13741
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 through this forum and tried all the suggestions which seemed applicable. Nothing is working. What is weird is that, it worked about four days ago when the site I made went live. Now the client wanted a few changes, and, though the code is all still...
2
2738
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 layered DIVs I had were no longer showing up correctly. I had this going fine for several hours -- it wasn't a happy accident I forgot to save. I'm totally mystified on this one. Here's the summary: I want #container to be under #containerbranch, so...
16
4921
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 "background" or "background-image", the positioning only works with specifying pixels. If I specify the vertical position in pixels, the image gets cut-off at the bottom. I don't know what to do and would appreciate anyone's help. Specifically the code...
10
5750
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 (small chocolate area) is positioning slightly down the page instead of at the top. I have used the same techniques in the navigation and it positions fine. Its fine in Fire Fox Opera & Safari. I have run my HTML & CSS through W3c and all is clean. ...
0
8067
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8157
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6820
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5479
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3967
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2477
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1336
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.