Change background color of HTML <area> tag

前端 未结 4 1610
时光取名叫无心
时光取名叫无心 2021-02-06 11:15

I have an image with more than 100 geometrical shapes with different size and dimensions, i used image mapping over it and assign id to each like

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-06 11:56

    The area element just makes part of an image clickable. It does not affect rendering, and setting background properties on it probably has no effect.

    The background would matter if the image contains transparent areas. In such a case, you could overlay (with CSS positioning) the image with another image of the same dimensions and containing the desired colors; this image would of course have a lower z-index value. But it would be simpler to put the backgrounds into the image directly (unless you wish to use different backgrounds in different situations).

提交回复
热议问题