php - Joomla 模板 - 将页脚放在底部

标签 php html css joomla-template

我正在尝试这样做:http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page 但是我自己做不到,所以我请求你的帮助。

我正在使用带有此代码的模板(仅限页 footer 分):

索引.php:

<div class="rt-footer-surround">
    <div class="rt-container">
      <div class="rt-footer-inner">
        <?php /** Begin Footer **/ if ($gantry->countModules('footer')) : ?>
        <div id="rt-footer">
          <?php echo $gantry->displayModules('footer','standard','standard'); ?>
          <div class="clear"></div>
        </div>
        <?php /** End Footer **/ endif; ?>
        <?php /** Begin Copyright **/ if ($gantry->countModules('copyright')) : ?>
        <div id="rt-copyright">
          <?php echo $gantry->displayModules('copyright','standard','standard'); ?>
          <div class="clear"></div>
        </div>
        <?php /** End Copyright **/ endif; ?>
      </div>
    </div>
</div>

css/template.css:

/* Footer */
.backgroundlevel-high .rt-footer-surround {padding-top: 135px;}
.rt-footer-inner {border-radius: 5px 5px 0 0;position: relative;z-index: 0;margin: 0 10px;}
.rt-footer-inner:after {content: "";position: absolute;top: 0;right: 0;left: 0;bottom: 0;z-index: -1;border-radius: 5px;}
.rt-footer-inner .rt-alpha {margin-left: 0;}
.rt-footer-inner .rt-omega {margin-right: 0;}
.backgroundlevel-high #rt-bottom {margin-bottom: -50px;}
#rt-bottom {margin-bottom: 15px;}
#rt-footer, #rt-copyright {margin: 0 -2px;}
#rt-copyright {position: relative;}
#rt-copyright .rt-grid-1, #rt-copyright .rt-grid-2, #rt-copyright .rt-grid-3, #rt copyright .rt-grid-4, #rt-copyright .rt-grid-5, #rt-copyright .rt-grid-6, #rt-copyright
.rt-grid-7, #rt-copyright .rt-grid-8, #rt-copyright .rt-grid-9, #rt-copyright .rt-grid 10,   #rt-copyright .rt-grid-11, #rt-copyright .rt-grid-12 {position: static;}

css/community-a.css:

/* Footer */
.rt-footer-inner {background-color: #1CA8D2;box-shadow: inset 1px 0 0 rgba(0,0,0,0.2), inset -1px 0 0 rgba(0,0,0,0.2), 0 0 6px rgba(0,0,0,0.4);color: #fff;text-shadow: 1px -1px 1px rgba(0,0,0,0.5);}
.rt-footer-inner .module-surround, .rt-footer-inner .title {color: #fff;text-shadow: 1px -1px 1px rgba(0,0,0,0.5);}
.rt-footer-inner a {color: #BCFEFF;text-shadow: -1px -1px 1px rgba(0,0,0,0.3);}
.rt-footer-inner a:hover {color: #fff;}

“community-a.css”是我使用的模板中的样式表。

如果有人能帮我解决这个问题,我会很高兴。

最佳答案

你在这里提供的信息是我的两分钱:

按照教程,您应该将以下 CSS 规则应用到容器元素(应该是 rt-footer-surround):

.rt-footer-surround {
    position:absolute;
    bottom:0;
    width:100%;
    height:60px;   /* Height of the footer */
}

这应该可以解决问题,当然您应该检查是否有其他一些 CSS 规则试图覆盖您正在做的修改,firebug 或其他开发人员工具非常适合这类事情。

编辑:像这样的东西 http://jsfiddle.net/4PRmk/1/

关于php - Joomla 模板 - 将页脚放在底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17423635/

相关文章:

php - 拉拉维尔。两个表的 Eloquent 查询

javascript - 为什么带有 php var 的 JavaScript 代码不起作用?

关于属性更改的 Php 运行方法

html - 使用 UTF-8 不显示特殊字符 ">"

jquery 不适用于特定的 html 文件

jquery - 如何正确使用 fullpage.js 的 onLeave() 函数?

jquery - 旋转设置为内联时水平翻转

html - 调整 li border-bottom "length"

javascript - 如何重复通过ajax检索数据的文本字段

c# - 改变全局化的方向 asp.net MVC