Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

image map for background image in a div tag

Posted on 2007-11-23
7
Medium Priority
?
6,562 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 800 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Find out what you should include to make the best professional email signature for your organization.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

972 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