HTML Background Image Map
Is it possible to create an image map from a background image? I'd like to have the sides of the screen clickable and I do not see any way to开发者_如何转开发 accomplish this without a map.
You may want to use transparent fixed floating <a>
anchor tags like these:
<a style="display: scroll; position: fixed; top: 25px; left: 0px; width: 20px; height: 20px;" href="#"></a>
<a style="display: scroll; position: fixed; top: 25px; right: 0px; width: 20px; height: 20px;" href="#"></a>
You may want to use the bottom
attribute instead of top
to position the tags relative to the bottom of the window.
You could create an absolute positioned image with the following css, so that it scales to fit the page.
img.bg{
position:absolute;
z-index:-100;
top:0;left:0;bottom:0;right:0;
}
and then use this lib to ensure the image map scales with the page.
https://github.com/davidjbradshaw/image-map-resizer
精彩评论