这是我的网站:http://bankloan.com-credit.info/freescore/limitedtime/lp1/001.php
如果将浏览器窗口缩小(大约 750x550),您会看到弹出图像杂乱地覆盖在正文上。我需要的是该弹出窗口不会杂乱无章。
我对代码了解不多。我只是使用了所见即所得的编辑器。我已经弄乱它几个小时了,无法修复它。
我很确定它与我的程序使用的绝对定位代码有关。
最佳答案
如果您需要 #message
弹出窗口始终位于顶部,您可以在 div
上设置一个高的 z-index
值,例如z-index: 9999
对于您的网站,您似乎使用了内联样式,因此您需要按如下所示添加它。
<div id="message" style="z-index:9999; font-family: arial; position: absolute; top: 16px; left: 318px; margin-left: -300px; background-image: url('images/alert.jpg'); background-repeat: no-repeat; margin-top: -15px; margin-bottom: 4px; width: 562px; height: 131px; font-size: 12px;" onclick="javascript: document.getElementById('message').style.display = 'none';" onmouseover="document.body.style.cursor='pointer'" onmouseout="document.body.style.cursor='default'">
关于html - 如何在html中隐藏图像下方的文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7078364/