【问题标题】:Make Joomla header static so always visible使 Joomla 标题静态所以始终可见
【发布时间】:2015-03-20 09:48:03
【问题描述】:

一位客户询问他是否可以将其网站的标题区域设为静态以便始终可见?

我正在使用 Eris 模板:http://hogash-demos.com/themeforest/?theme=eris_joomla

我的网站是:http://www.negotiumrecruitment.co.uk/dev

带有徽标、联系信息和导航的顶部区域以及下方的行都希望保持原位,当滚动时,整个网站向上移动,顶部区域始终保持可见。

提前谢谢你。

保罗·沃克

【问题讨论】:

    标签: css scroll header css-position fixed


    【解决方案1】:

    你可以试试:

    #rt-header {
      position: fixed;
      top: 0;
      width: 100%;
    }
    

    具有固定位置的元素相对于浏览器定位 窗口,即使窗口滚动也不会移动

    来源:http://www.w3schools.com/css/css_positioning.asp

    编辑:看到您证明的网站,您还需要更改您的 #rt-logo CSS 规则。它目前是“绝对的”,应该是“固定的”:

    #rt-logo {
      display: block;
      position: fixed; /* Instead of 'absolute' */
      left: 50%;
      top: 0;
      margin-left: -470px;
      z-index: 9999;
    }
    

    这是因为您的徽标位于模板中的标题之外。通常它会在标题内,你不需要这个。

    【讨论】:

    • 谢谢,我试试看
    • 不客气@PaulWalker。如果它解决了您的问题,如果您可以将答案标记为已接受,那就太好了。最好的问候
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-07-05
    • 1970-01-01
    • 1970-01-01
    • 2011-08-27
    • 1970-01-01
    • 2017-11-30
    • 1970-01-01
    相关资源
    最近更新 更多