English 中文(简体)
Div, Background Image, and Image Map
原标题:

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?

问题回答

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

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

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





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签