javascript - 仅在 IE 中按钮位置不正确

标签 javascript html css

我有 2 个按钮,它们应该显示在另一个 div 上方。但是在 Internet Explorer 中,2 个按钮显示在与 div(应该在下方)相同的 y 水平/轴上。

注意:HTML 在 Firefox 和 Chrome 中正确显示(2 个按钮在 div 上方)但在 IE 上,按钮不显示在 div 上方。

它应该是这样的,它在 firefox 中确实是这样的:
enter image description here 但这是 IE 显示 HTML 的方式:
enter image description here 你能帮我修复显示,使 2 个按钮位于 IE 中“类(class)”div 的上方吗?

<html>
<head>
    <title> </title>

    <style type="text/css">
    <!--
        #navBar {
            text-align: left;
            margin: 0 auto;
            padding: 0 auto;
            margin-top: 10px;
            position: fixed;
        }

        .leftAlignButton {
            margin-left: 2px;
            float: left;
        }

        .rightAlignButton {
            float: right;
            margin-right: 54px;
        }

        .navTab {
            background: url(images/tag.png) top right no-repeat;
            overflow: hidden;
            padding: 8px 10px 12px 10px;
            width: 155px;
            height: 50px;
        }

        .navTab select {
            width: 110px;
            height: 25px;
        }

        .navTab input {
            width: 100px;
        }

        .navText {
            color: #FFFFFF;
            font-family: "Onyx", "Arial", Serif;
            font-size: 23px;
            letter-spacing: 1px;
        }
    -->
    </style>
</head>
<body>

    <div id="navBar">
        <div id="buttonTab">
            <a class="leftAlignButton" href=""><img src="images/closeBt.png" alt="Close"/></a>
            <a class="rightAlignButton" href=""><img src="images/goBt.png" alt="Go"/></a>
        </div>
        <div class="navTab">
            <p class="navText">Course:</p>
            <select>
                <option>Breakfast</option>
            </select>
        </div>
    </div>


</body>
</html>

最佳答案

尝试添加

#buttonTab { overflow:hidden }

编辑:只是阅读其他人提交的相同内容。

关于javascript - 仅在 IE 中按钮位置不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7943343/

相关文章:

javascript - 用鼠标单击时如何更改 anchor 类的类?

javascript - Fancybox 在加载时调整大小无法正常工作

javascript - 将处理程序附加到 DocumentSelectionChanged 事件会禁用 Office for Mac 上的撤消堆栈

javascript - 如何使用jquery-tabledit通过javascript将变量传递给ajax?

javascript - 设置不转发到网站的 cookie

php - 为什么首先 php echo indent(tab)?

javascript - 使用 javascript 突出显示字段

javascript - 如何制作具有多个系列启用器/禁用器的人力车传奇?

css - 在现有的 div 之上添加层

html - 字体系列声明不起作用