Solved

image map for background image in a div tag

Posted on 2007-11-23
7
6,549 Views
Last Modified: 2013-11-19
Hi

Can someone please tell me how I can create some maps for an image thats the background of a div tag.
<div id="maindiv" style="border: 1px solid blue; background-image: url(background800600full.gif); width: 800px; background-repeat: repeat-x;" align="center">
I'd like to create maps for 3 segments of the image.  Im a novice to maps, divs etc and the tutorials online dont have exactly what I'm looking for
Also I have just noticed that on my local browser the image appears but when I upload to my webserver it doesnt appear unless I do a direct insert ie <IMG>

Much appreciated
Louise
0
Comment
Question by:louise_8
  • 3
  • 2
7 Comments
 
LVL 18

Accepted Solution

by:
Eternal_Student earned 200 total points
ID: 20338400
Firstly, you cannot put an image map on a background image but you CAN lay a transparent gif on top of that:

http://www.recentrambles.com/pragmatic/view/35

Not sure what you are trying to achieve, but it sounds like that could be a solution ^.

The second issue is probably to do with the path to your image. If you are using an external style sheet then the link will probably have a different path than when you enter it into the html page. Depends on how your site is structured of course.
0
 

Author Comment

by:louise_8
ID: 20338591
Thanks Eternal Student, love the name :)
Im not using an external style sheet for my div just this code; background-image: url(background800600full.gif);  with background800600full.gif being stored in the same folder, does that indicate what Im doing wrong?

I will implement the other code for the map as soon as I get the above working and let you know

Cheers
0
 
LVL 18

Expert Comment

by:Eternal_Student
ID: 20338802
Put the background style in the css at the top:

<style type="text/css">
#divname{background-image: url(background800600full.gif);}
</style>

Providing the image is uploaded and in the same directory as this page then it should load. You will also need to give the div the correct id. If this doesnt work then send me a link and I will be able to work out why.


0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:louise_8
ID: 20347551
Thanks, heres the link http://www.resource-central.org/louise/louiseg.html if i just include the background image in the css code it wont work locally.  Ive left both in, you'll probably figure it out straight away :)
0
 
LVL 3

Expert Comment

by:anandhariharan
ID: 20497784
Try this! This sure should solve your problem
<div id="maindiv" style="border: 1px solid blue; background-image: url(background800600full.gif); width: 800px; background-repeat: repeat-x;" align="center">

<a href="something.htm" style="display:block; width:800px; height:100px;">&nbsp;</a>

</div>

Open in new window

0
 

Author Comment

by:louise_8
ID: 20678736
apologies for the delay getting back on this.  I thought I had accepted this, perhaps the page crashed.. and only noticed when I logged back in today after 6 weeks- I have been away.  
Thanks Eternal student for your help and anyone else that contributed
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now