我找到了很多解决此主题的帖子,但是我的代码仍然遇到问题:
<div id="product_tabs_description_tabbed_contents" style="display: block;"><img style="margin-left: -10px; opacity: 1 !important;" src="{{media url="brands.png"}}" alt="" width="754" usemap="#brands_map" /></div>
<a href="javascript:void(0)"><map class="maptest" name="brands_map">
<area title="Nike" shape="rect" coords="4,3,73,41" href="#" alt="Nike" class="0" />
<area title="Lonsdale" shape="rect" coords="99,7,168,45" href="#" alt="Lonsdale" class="1" />
<area title="No Fear" shape="rect" coords="206,5,284,42" href="#" alt="No Fear" class="2" />
<area title="Karrimor" shape="rect" coords="317,9,376,62" href="#" alt="Karrimor" class="3" />
</map> </a>
我拥有的是黑白的 first.png 和彩色的 second.png。我需要在悬停时为当前品牌着色。可以找到示例:http ://www.bestsports.sk/
我正在使用图像映射,但我不知道如何配置 css 以使其工作。我也无法访问我的外部 css 文件,所以我必须将 css 代码直接放在 html 中。