css - 在 IE8 中关闭 Div 放置

标签 css html position

我知道这个 fiddle 不是那么好,因为它看起来有点乱,因为我没有包含我所有的代码,但你可以得到一般的想法:

Fiddle

它在 FF 和 Chrome 中运行良好,但在 IE8 中,主要的文本 block 和下面的 3 个 div 变得一团糟,并重叠在左侧的菜单上。

是否与我需要在某处包含的 position:relative 有关?

我需要添加什么来阻止 div 重叠?

有没有人可以在更高的 IE 中检查 fiddle ,因为我只有 8

最佳答案

我已经设法稍微清理了 HTML 和 CSS,但在继续之前,您还应该考虑进行更多更改。我肯定会考虑删除 CSS 中的重复,有许多重复的属性可以组合成多个选择器的单个属性。您还应该确保您正在编写有效的 HTML,因为这也会导致跨浏览器呈现问题。

See demo或下面的示例代码。

HTML

<div class="allinfo">
    <div class="menu">
        <div class="menutop">WATCHGUARD SHOP MENU</div>
        <ul class="menuoptions">
            <li><span class="redtext">WatchGuard Home</span>

            </li>
            <li>XTM Series Firewalls</li>
            <li>XCS Series Firewalls</li>
            <li>SSL VPN Encryption</li>
            <li>Security In Education</li>
            <li>Wireless Access Points</li>
            <li>FREE Quotation</li>
        </ul>
        <div class="tradein">TRADE IN</div>
        <div class="tradeininfo">
            <strong>Trade Up</strong>
            <p>Trade in an earlier generation WatchGuard appliance or any approved non-WatchGuard appliance-based security solution, and trade up to eligible new WatchGuard solutions at 25% off the standard purchase price.</p>
        </div>
        <div class="whitepapers">WHITEPAPERS</div>
        <div class="whitepapersinfo">
            <ul>
                <li>Take Back Control</li>
                <li>Data Loss Prevention</li>
                <li>Securing the Virtual World</li>
            </ul>
        </div>
    </div>
    <div class="maintext">
         <h5>Welcome To The WatchGuard Homepage</h5>

        <br/>
        <p>WatchGuard builds affordable, all-in-one network and content security solutions to provide defense in depth for corporate content, networks and the businesses they power.</p>
        <p>WatchGuard's award-winning extensible threat management (XTM) network security solutions combine firewall, VPN and security services to protect networks from spam, viruses, malware and intrusions.</p>
        <p>The new Extensible Content Security (XCS) appliances offer content security across e-mail and web combined with data loss prevention for complete content protection.</p>
        <p>WatchGuard extensible solutions scale to offer right-sized security for small businesses up to enterprises with 10,000+ employees.</p>
        <p>Since our founding in 1996, more than 600,000 WatchGuard signature red security appliances have been deployed worldwide. Today more than 15,000 dedicated partners back our products in 120 countries.</p>
        <div class="products">
            <div class="product"> <span>WatchGuard SSL/VPN</span>

                <br/>
                <br/>
                <br/>
                <img src="images/watchguard-tb-ssl.jpg" width="199" />
                <br/>
                <br/>
                <p>Remote connectivity. Secure remote access that just works.</p>
            </div>
            <div class="product"> <span>WatchGuard XCS</span>

                <br/>
                <br/>
                <br/>
                <img src="images/watchguard-tb-xcs.jpg" width="117" height="72" />
                <br/>
                <br/>
                <p>Content security. Defense in-depth email security and web security.</p>
            </div>
            <div class="product"> <span>WatchGuard XTM</span>

                <br/>
                <br/>
                <br/>
                <img src="images/watchguard-tb-xtm.jpg" width="122" height="72" />
                <br/>
                <br/>
                <p>Multi-function firewalls. Incredible speed. Unbelievable value.</p>
            </div>
        </div>
    </div>
</div>

CSS

.redtext {
    color:#DF0005;
}
.banner {
    position:relative;
    top:10px;
}
.menu, .maintext {
    display:table-cell;
    padding:10px;
}
.maintext {
    height:500px;
    font-size:smaller;
    font-weight:normal;
    vertical-align:top;
    margin-left:240px;
}
.maintext h5 {
    font-weight:lighter;
}
.menu {
    position:relative;
    width:235px;
}
.menutop {
    height:30px;
    background-color:rgb(221, 221, 221);
    color:#666;
    line-height:30px;
    font-weight:bold;
    border-style:solid;
    border-width:1px;
    border-color:#CCC;
    text-indent:10px;
    font-size:smaller;
}
.menuoptions {
    color:#666;
    line-height:30px;
    font-weight:bold;
    list-style:none;
    padding: 0;
    font-size:smaller;
}
.menuoptions li {
    border-bottom:solid 1px #ccc;
    padding-left:10px;
}
.tradein {
    background-color:rgb(221, 221, 221);
    color:#666;
    line-height:30px;
    font-weight:bold;
    border-style:solid;
    border-width:1px;
    border-color:#CCC;
    text-indent:10px;
    font-size:smaller;
}
.tradeininfo {
    color:#333;
    border-style:solid;
    border-width:1px;
    border-color:#CCC;
    padding:10px;
    font-size:smaller;
}
.whitepapers {
    background-color:rgb(221, 221, 221);
    color:#666;
    line-height:30px;
    font-weight:bold;
    border-style:solid;
    border-width:1px;
    border-color:#CCC;
    text-indent:10px;
    font-size:smaller;
}
.whitepapersinfo {
    color:#666;
    border-style:solid;
    border-width:1px;
    border-color:#CCC;
    line-height:30px;
    font-weight:bold;
    font-size:smaller;
}
.whitepapersinfo li:not(:last-child) {
    border-bottom:solid 1px #ccc;
}

.product {
    position:relative;
    width:205px;
    height:205px;
    border-style:solid;
    border-width:1px;
    border-color:#CCC;
    margin:5px;
    padding:10px;
    text-align:center;
    display:inline-block;
    vertical-align:top;
}
.product span {
    position:relative;
    font-size:18px;
    margin:0 auto;
    color:#333333;
}
.product p {
    text-align:left;
    font-size:smaller;
    color:#333333;
}

关于css - 在 IE8 中关闭 Div 放置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19633496/

相关文章:

html - 在 div 中覆盖类

html - 带有 HTML 和 CSS 的代码元素破坏了我在 Shopware 中的购物世界

javascript - 从 Webview 中加载的页面在 Safari 中打开链接

javascript - slider 覆盖 slider 后的内容。为什么?

css - 元素被定位在元素之外

html - 如何在固定尺寸外部 div 中包含的内部 div 上获得垂直滚动条?

javascript - 当我单击时引​​导切换按钮不起作用

html - 'glyphicon glyphicon-plus' 不显示

html - 如何让 PreMailer.Net 不更改非 ascii 字符的编码?

javascript - 隐藏和显示父元素标签 JS/Jquery