0

我正在为 joomla 2.5.6 编写自己的模板。我不确定这个问题是 Joomla 还是简单的 css 相关。

模板很简单,左边有一个侧边栏,右边有一个内容,还有一个页脚。现在当内容很短并且侧边栏上有几个模块时,模块会与页脚重叠。

它看起来像这样:

http://imageshack.us/photo/my-images/269/screenshotmdph.jpg/

index.php 中的 html 如下所示:

<body>
<div class="container_6">
    <div class="grid_6 header">
        <a href="<?php echo $this->baseurl ?>" title=""><img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/assets/images/logo.png" alt="home" id="logo"/></a>
        <jdoc:include type="modules" name="menu" />
    </div>
</div>
<div class="container_6">
    <div class="grid_6 head_logo">
        <jdoc:include type="modules" name="header_logo" />
        <div class="left_menu">
            <div class="left_menu_content">
                <jdoc:include type="modules" name="left_menu" style="xhtml" />
            </div>
        </div>
        <div class="right_module">
            <jdoc:include type="modules" name="right" />
        </div>          
    </div>
</div>
<div class="container_6">
    <div class="grid_6">
        <div class="content">
            <div class="content_holder">
                <!-- beginn content -->
                <div class="container_6">
                    <div class="content_component">
                        <jdoc:include type="modules" name="breadcrumb" />
                        <jdoc:include type="component" />
                    </div>
                </div>
            </div>          
        </div>
    </div>
</div>
<div class="clear"></div>
<div class="container_6">
    <div class="grid_6">
        <div class="footer">
        </div>
    </div>
</div>

我使用了 960-grid 系统,它上面有明确的类,但这里定义了其他类:

    .header {
 background: url('../images/top.png') no-repeat;
 height:93px;
 width:100%;
}

.head_logo {
    background: url('../images/shadow.png') repeat-y;
    padding-right:10px;
    padding-left:12px;
    z-index:1;
    position:absolute;
}
.left_menu {
    background: url('../images/menuBg.png') no-repeat;
    width:284px;
    min-height:611px;
    top:300px;
    z-index:2;
    position:absolute;
}
.right_module {
    width:180px;
    height:40px;
    padding:10px;
    background-color:#e9e9e9;
    top:300px;
    left:730px;
    z-index:3;
    position:absolute;
}

.content {
    background: url('../images/shadow.png') repeat-y;
    min-height:500px;

}
.content_holder {
    background-color:#e9e9e9;
    width:960px;
    margin-left: auto;
    margin-right: auto;
    min-height:500px;
}

.content_component {
    width:666px;
    padding:5px 5px 5px 284px;
    margin:0 5px;
}

#logo {
    margin:15px 0 0 25px;
    float:left;
}

.footer{
    background: url('../images/bottom.png') no-repeat;
    width:100%;
    height:92px;
}

我对此感到迷茫,因为由于页脚上方的清除类它应该可以工作,但它没有..不幸的是我没有在线示例,它都是本地的

有人知道我怎么能找到错误吗?太感谢了

附加信息:

对不起,我忘记了,

<div class="clear"></div>

在 grid.css 中定义,如下所示:

.clear {
  clear: both;
  display: block;
  overflow: hidden;
  visibility: hidden;
  width: 0;
  height: 0;
}

我也编辑了问题标题,抱歉错了

添加!!

我想添加问题的屏幕截图。请看这里:

http://www.bilder-hochladen.net/files/jegt-i-6f49-jpg.html

您会看到,.left-menu 以绝对位置定位并在 .head-logo 类内部开始。.left-menu 不应进入紫色页脚。

如何告诉内容 div 与左侧菜单的高度相同?

4

2 回答 2

1

使用Clear:both代替clear:allwhich 不是 MHO 中的样式定义。

于 2012-09-13T06:47:30.140 回答
0

从表面上看,您可能将“清晰”的 div 放置在错误的位置,但很难说,没有看到附加了所有 css 的实际页面,包括网格的。也许您可以实际生成页面,保存到本地磁盘并使其在线?

于 2012-09-13T11:10:06.237 回答