html - CSS:修复 div 位置

标签 html css

我试图修复 response div 的位置: HTML 是:

<div id="response">
<table width="100%" cellspacing="5" style="background-image:url(images/bg.gif); background-repeat:no-repeat; width:100%;">
    <tr>
        <td class="clock" colspan="2"><?php include'scripts/clock.html'; ?></td>
    </tr>
</table>
</div>
<div>
<img src="images/map.gif" border="0" usemap="#Msj_Map" alt="map" class="map" />
<map name="Msj_Map" id="Msj_Map">   
    <area id="8" shape="poly" coords="436,141,486,141,486,207,436,206" />
    <area id="1" shape="poly" coords="163,148,163,170,159,170" />
    <area id="2" shape="poly" coords="163,207,153,207,159,173,163,173" />
    <area id="189" shape="poly" coords="198,281,199,307,161,307,161,282" />
    <area id="190" shape="poly" coords="198,309,199,333,161,334,161,309" />
    <area id="165" shape="poly" coords="540,230,570,230,577,236,577,271,540,271" />
    <area id="40" shape="poly" coords="384,1156,419,1156,419,1180,383,1180" />
    <area id="39" shape="poly" coords="422,1156,458,1156,458,1180,422,1181" />
    <area id="54" shape="poly" coords="321,1109,353,1109,359,1116,360,1159,321,1159" />
    <area id="29" shape="poly" coords="356,1235,387,1235,387,1274,356,1274" />
    <area id="22" shape="poly" coords="390,1277,457,1277,457,1311,453,1315,390,1315" />
    <area id="23" shape="poly" coords="321,1277,387,1277,387,1315,321,1315" />
    <area id="24" shape="poly" coords="319,1277,319,1316,252,1316,252,1277" />
</map>
</div>

喜欢http://www.noobcube.com/wp-content/uploads/demos/062709-fixed-header-footer/demo/ 我使用了它的逻辑,但在实现过程中我发现 <map>标签不与其他元素一起发挥作用,因为 <map>在图像上绘制,因此不支持 overflow:scroll .但是<map>是我代码中的关键元素。

可能有一些其他的解决方案来修复它。

最佳答案

经过长时间的努力,我找到了 z-index 并为 response<map> 创建了 css分区:

.calculator{
    z-index:1000;
    position:fixed;
    top:0px;
}
.map-wrap{
    margin-top:350px;
}

<div id="response" class="calculator">
<table width="100%" cellspacing="5" style="background-image:url(images/bg.gif); background-repeat:no-repeat; width:100%;">
    <tr>
        <td class="clock" colspan="2"><?php include'scripts/clock.html'; ?></td>
    </tr>
</table>
</div>
<div class="map-wrap">
<img src="images/map.gif" border="0" usemap="#Msj_Map" alt="map" class="map" />
<map name="Msj_Map" id="Msj_Map">   
    <area id="8" shape="poly" coords="436,141,486,141,486,207,436,206" />
    <area id="1" shape="poly" coords="163,148,163,170,159,170" />
    <area id="2" shape="poly" coords="163,207,153,207,159,173,163,173" />
    <area id="189" shape="poly" coords="198,281,199,307,161,307,161,282" />
    <area id="190" shape="poly" coords="198,309,199,333,161,334,161,309" />
    <area id="165" shape="poly" coords="540,230,570,230,577,236,577,271,540,271" />
    <area id="40" shape="poly" coords="384,1156,419,1156,419,1180,383,1180" />
    <area id="39" shape="poly" coords="422,1156,458,1156,458,1180,422,1181" />
    <area id="54" shape="poly" coords="321,1109,353,1109,359,1116,360,1159,321,1159" />
    <area id="29" shape="poly" coords="356,1235,387,1235,387,1274,356,1274" />
    <area id="22" shape="poly" coords="390,1277,457,1277,457,1311,453,1315,390,1315" />
    <area id="23" shape="poly" coords="321,1277,387,1277,387,1315,321,1315" />
    <area id="24" shape="poly" coords="319,1277,319,1316,252,1316,252,1277" />
</map>
</div>

然后摆脱它。 :)

谢谢大家。

关于html - CSS:修复 div 位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9845820/

相关文章:

javascript - 提交 HTML 文本表单?

jquery - 样式 <select/> 元素的 IE 问题

javascript - Safari Jquery 事件处理程序延迟

javascript - 在 html 表中的两个字段之间画线?

javascript - 引导关闭 Canvas 菜单显示小于 992px

css - 翻转时图像倾斜 - 无法弄清楚为什么

c# - 长文字和图片排成一排,缩小图片

html - 如何在 CSS 边框形状中创建平滑的边缘?

html - 为什么 MS Edge 上的路径描边宽度比其他浏览器大?

css - 单击后如何增加和调整 css doc 菜单面板图像的大小..?