取决于操作系统的浏览器开关

时间:2018-07-03 11:20:46

标签: css windows internet-explorer

最近,一个访客抱怨一些DIV覆盖页面内容。

当鼠标悬停在其容器上时,实际上仅应显示 的弹出窗口:

<td class="ref" id="myContainer">
    <div><a href="otherscript.php">link text</a></div>
    <div style="position:absolute;width:200px;background-color:white">
        <?php include 'div-content.php';  ?>
    </div>
    <style type="text/css">#XcatContainer > div { display: none } #XcatContainer > div:first-child, #XcatContainer:hover > div { display: block }</style>
</td>

在Windows 10和Linux(包括IE11)上的所有浏览器中都能像魅力一样工作。但是,它在Windows 7的IE11(和Vista的IE 6)中不起作用。

现在,我正在考虑使用浏览器开关来禁用这些浏览器中的弹出窗口。我可以使用[!if IE];但是我想我需要JS或PHP才能仅在较旧的Windows上添加它。

还是可以重新格式化使其起作用?

1 个答案:

答案 0 :(得分:0)

您确实需要PHP才能从UserAgent中过滤掉操作系统。

this answerFunk Forty Niner中提供了更多信息。