我遇到了CSS让广告排队的问题

时间:2013-07-31 05:34:36

标签: html css

我正在建立一个网站,我的页面底部有三个广告。他们出现但在那里有自己的路线。我已经尝试了从创建浮动div到删除div的所有内容。但我似乎无法弄清楚CSS的哪一部分不允许这些框在整个页面上直接显示。

以下是三个框的代码:

<div class="wrapper margin-bot1">
    <div class="bg-3">
        <div class="indent">
            <div class="wrapper margin-bot">
                <img src="http://www.webstertoolbox.com/media/wysiwyg/images/page1_img1.png" alt="" />
                <img src="http://www.webstertoolbox.com/media/wysiwyg/images/logo_archilume.png" alt="" width="150" height="41" />
            </div>
            <ul class="ul-1">
                <li><a href="moreARCHI.html">Made in USA </a></li>
                <li><a href="moreARCHI.html">Expert Domestic Tech Support</a></li>
                <li><a href="moreARCHI.html">High-end installations</a></li>
                <li>Robust features</li>
            </ul>
            <a class="button-1 margin-left" href="more.html">Click to Order Now!</a>
        </div>
    </div>
    <div class="bg-3">
        <div class="indent">
            <div class="wrapper margin-bot">
                <img  src="http://www.webstertoolbox.com/media/wysiwyg/images/page1_img1.png" alt="" />
                <a href="moreGEN.html"> <img src="http://www.webstertoolbox.com/media/wysiwyg/images/GenLume-Logo.png" alt="" width="103" height="41" /></a>
                <div class="extra-wrap">&nbsp;</div>
            </div>
            <ul class="ul-1">
                <li><a class="test123" href="moreGEN.html">Quick solutions</a></li>
                <li><a href="moreGEN.html">Turn-key applications</a></li>
                <li><a href="moreGEN.html">Certified</a></li>
                <li><a href="moreGEN.html">Competitive pricing</a></li>
            </ul>
            <a class="button-1 margin-left" href="moreGEN.html">Click to Order Now!</a>
        </div>
    </div>
    <div class="bg-3">
        <div class="indent">
            <div class="wrapper margin-bot">
                <img src="http://www.webstertoolbox.com/media/wysiwyg/images/page1_img1.png" alt="" />
                <div class="extra-wrap">
                    <h4>DuraLume</h4>
                    <h5>Series</h5>
                </div>
            </div>
            <ul class="ul-1">
                <li><a href="more.html">Expert Domestic Tech Support</a></li>
                <li><a href="more.html">Made in USA </a></li>
                <li><a href="more.html">Custom solutions</a></li>
                <li><a href="more.html">On-site Engineers</a></li>
            </ul>
            <a class="button-1 margin-left" href="more.html">Click to Order Now!</a>
        </div>
    </div>
</div>

我无法弄清楚如何正确显示CSS,但您可以在此处找到实际网站:http://www.webstertoolbox.com/

如果您在Big横幅下方看到,您将看到一个垂直向下运行的ArchiLume,GenLume和DuraLume框。我希望它们出现在整个页面上。

有人可以告诉我我做错了什么以及如何解决它?

谢谢, 弗兰克G。

2 个答案:

答案 0 :(得分:1)

修复它非常简单快捷。 只需在第128行更改名为homeads.css的css文件:

.bg-3 
{
    background: url(../images/bg-4.png) left top no-repeat;
    width: 33%;  // Changed this from 100% to 33%
    height: 322px; //Changed from 268px to 322px
    overflow: hidden;
    float: left;  // Added the float left
}

干杯, 萨诺斯

编辑:完成上述更改后,您需要添加一些更改来修复一些会导致错位的内容。 如右边框将不再可见。以下是您需要做的修改以解决这个问题。

在homeads.css第33行:

.main 
{
    width: 950px; // Reduced this to match with the parent's width
    padding: 0;
    margin: 0 auto;
    position: relative;
}

在sceleton.css第25行:

.grid_1, .grid_2, .grid_3, .grid_4, .grid_5, .grid_6, .grid_7, .grid_8, .grid_9, .grid_10, .grid_11, .grid_12, .grid_13, .grid_14, .grid_15, .grid_16, .grid_17, .grid_18, .grid_19, .grid_20, .grid_21, .grid_22, .grid_23, .grid_24 
{
    float: left;
    display: inline;
    //margin-left: 5px;    Remove these 2
    //margin-right: 5px;   Remove these 2
}

EDIT2:第一个框被推下了一点点。这是因为在第一个框中你缺少一个div&lt; - &gt;在第二个和第三个方框中,你有一个额外的div。

<div class="wrapper margin-bot">
    <img src="http://www.webstertoolbox.com/media/wysiwyg/images/page1_img1.png" alt=""><a href="moreGEN.html"> <img src="http://www.webstertoolbox.com/media/wysiwyg/images/duralume.gif" alt="" width="103" height="41"></a>
    <div class="extra-wrap">&nbsp;</div> // THIS IS THE EXTRA DIV
</div>

您有2个选择:

1)添加div

<div class="extra-wrap">&nbsp;</div>

到第一个方框

2)从方框2和3中删除该div。

答案 1 :(得分:1)

.cms-home类帮助您不影响其他页面布局。添加样式表:

.cms-home .wrapper {
    overflow: visible; //For big banner
}
.cms-home .bg-3 {
    overflow: visible;
    width: 33%;
    display: inline-block;
}