Div, Background Image, and Image Map
Asked Answered
L

3

6

On a web page I'm creating, I have a div with a background image. I overlay some text over the image that I'll be changing frequently, so that's why I'm using a background image and real text instead of an img tag that contains the text.

The background image contains some click-able areas, so I need an image map.

I think the best way to do this is to have another overlay div with a transparent image, and have an image map for the transparent image that corresponds to the background area click-able areas.

Am I on the right track, or is there a better way?

Lettielettish answered 13/11, 2009 at 12:21 Comment(0)
F
6

If you only need the "rectangle" shape for the links in the image map, you could use css defined link positions instead. This is accomplished by specifying the position and setting the background-color to transparent. Here is an example: http://www.position-relative.com/tutorials/tute1_css_bg_image.php

Flatware answered 13/11, 2009 at 12:43 Comment(0)
N
1

something you might try is placing the background div on "float" IE

div.background { float:left; }

since its got a "float" on it the size of the background wont push the divs that come after it to the side...

then you can make a second div to contain all the text stuff and then use something like :

div.textarea{ position:realtive; left:50px; }

to position the text area (that youll be editing a lot) above the div background

Nidorf answered 18/6, 2010 at 22:41 Comment(0)
W
1

IE6 doesn't support transparency so I recommend you use the IE6 png fix hack.

Wistrup answered 26/10, 2011 at 19:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.