Joomla Footer页面中间有100%高度DIV

时间:2017-06-29 07:18:20

标签: html css joomla

我必须使用Joomla框架并创建100%高度的DIV。我成功完成了这个。但是,当尝试添加页脚时,它会飞向屏幕顶部并覆盖所有内容。

通过DOM进一步检查后,我发现了一些有趣的东西:由框架类自动添加.item-page和div itemprop =" articleBody"将它们在DOM树中的所有部分都放在DOM树中,就像它们应该只包含高度方面的第一个DIV一样。所以看起来我的页脚试图适应第一个DIV。

为了记录,我成功加载了Bootstrap 3。

非常感谢帮助。

HTML - INDEX.PHP

<div class="container-fluid">
  <nav class="navbar" role="navigation">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" 
                data-toggle="collapse" 
                data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
        <div class="collapse navbar-collapse">
          <jdoc:include type="modules" name="nav" style="html5" />
        </div>
    </nav>


    <jdoc:include type="message" />
    <jdoc:include type="component" />

<!--END CONTAINER-->
</div>
<footer>
    <div class="container">
        <div class="row footer-container footer-row">
            <div class="col-sm-3">
                <div class="footer-logo">Logo</div>
            </div>

            <div class="col-sm-9">
                <p class="footer-about">
                    About
                </p>
                <p class="footer-text">
                    Footer content here
                </p>
            </div>

            <div class="col-sm-3">
                <p class="footer-about">
                    Contact Info
                </p>
            </div>
        </div>
    </div>
    </footer>

HTML - 受影响页面的代码编辑

<div class="container-fluid">
    <div id="landing-bkg">
        <div class="row">
            <div class ="col-sm-7 col-xs-12">
                <h1>Headline</h1>
                <h3>Subhead</h3>
                <div class="btn">
                    <p>Button</p>
                </div>
            </div>
        <!-- END COL -->
        </div>
        <!-- END ROW -->
    </div>
    <!-- END LANDING BKG-->

    <div id="another2">
        <div class="row">
            <div class="col-sm-12">
                <h2 class="center">Headline</h2>
                <h3 class="center">Subhead</h3>
                <div class="btn btn-center">
                    <p class="center">Button</p>
                </div>
            </div>
        <!-- END COL -->
        </div>
        <!-- END ROW -->
    </div>
    <!-- END ANOTHER2-->

    <div id="another3-bkg">
        <div class="row">
            <div class="col-sm-12">
        <div class="row">
                    <div class ="col-md-7 col-sm-12 col-xs-12">
                        <h2>Headline</h2>
                        <h3> Subhead</h3>
                        <div class="btn">
                            <p>Button</p>
                        </div>
                    </div>
                    <!-- END NESTED COLUMN -->
                </div>
                <!-- END NESTED ROW -->
            </div>
        <!-- END COL -->
        </div>
        <!-- END ROW -->
    </div>
    <!-- END ANOTHER3 BKG-->

    <div id="another4">
        <div class="row">
            <div class="col-sm-12">
                <h2 class="center">Subhead</h2>
                <form>
                    <input type="email" placeholder="Input Field" class="center-block">
                </form>
                <div class="btn btn-center">
                    <p class="center">Button</p>
                </div>
            </div>
        <!-- END COL -->
        </div>
        <!-- END ROW -->
    </div>
    <!-- ANOTHER 4 -->
</div>
<!-- END CONTAINER -->

CSS

/****HTML & BODY ****/

html,
body{
    width:100%;
    height:100%; //Makes my DIVs 100% height, works great
    margin:0;
    padding:0;
}

/****CONTAINER ****/
.container-fluid{
  100%
}

/**** JOOMLA CLASSES I OVER RIDE TO GET THE DIVS AT 100% DOESN'T WORK WITHOUT IT ****/
.item-page{
  height:100%;
}
div[itemprop="articleBody"]{
 height:100% !important;
}


/**** FOOTER ****/

.footer-container{
    background-color:#565A5C;
    width:100%;
    padding-top:50px;
    padding-bottom:25px;
}

footer{
    position:relative;
}

.footer-row{
    width:100% !important;
    margin:0 !important;
}

1 个答案:

答案 0 :(得分:0)

不是100%肯定你想要的东西,但是:

footer{
    position:absolute;
    bottom: 0;
}  

应正确放置页脚。然后将 padding 添加到其他元素以避免它们覆盖页脚。