html - 在文本前面设置图像映射

标签 html css z-index imagemap

我有这张图片的 img 和图片映射。

现在我想使用 css-property: z-index 将文本放在图像映射后面但在图像前面。

文本仍然可以点击并且不在图像映射后面。 这是代码:

<div style="position:relative;">
        <img src="/images/bildungssystem_notext.png" alt="Bildungssystem" style="margin-top:2px;" usemap="#uebersicht"/>
        <map name="uebersicht" id="uebersicht">
            <area shape="poly" coords="365,55,398,56,432,58,431,53,450,53,450,59,521,62,521,52,542,53,542,64,558,65,558,52,544,52,496,51,494,37,395,36,394,52" id="Sonderschule" alt="Sonderschule" onclick="return false;" href="#" target="_self" />
        </map>
        <div class="text-layer volksschule" >Primary School (Volksschule)</div>
    </div>
    </div>

为了更好的监督,我删除了一些元素。

这是文本层类的 CSS:

position: absolute;
color: #fff;
z-index: 1;

map 的 z-index 为 2,Image 为 -1

请帮帮我,

伯恩哈德

最佳答案

我用不同的方法解决了我的问题。 我忽略了 z-index 并使用了 css-property“pointer-events”并将其设置为 none。

pointer-events: none;

关于html - 在文本前面设置图像映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37586697/

相关文章:

php - 悬停时隐藏 <a> 标签上的标题

css - 是什么导致了这个 WP 页面样式的不同?

html - IE7 Z-Index 问题(CSS DropDown)

jquery - 工具 slider Z-Index 分层问题

html - CSS p {Indent} 留空

html - <ul> 上的 tabindex ="-1"不起作用

jquery - 简单的 jQuery 旋转木马幻灯片计数器

Jquery hover_caption插件隐藏透明度,是z-index吗

javascript - JQuery 移动更改颜色以单击 ListView

html - CSS Mask-image 不起作用