Bootstrap页脚,页面全宽

编程入门 行业动态 更新时间:2024-10-11 13:29:22
本文介绍了Bootstrap页脚,页面全宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用joomla设计网站并使用bootstrap框架. 现在我的页脚有问题.基本上,我使用简单的网格布局,并且我希望网站的内容部分位于页面的中心,左右两侧都有空间,这已经实现了. 现在,我希望页脚不在内容的中间,而在页面的末尾,而不是整个页面的宽度,并且不固定.因此,我通常希望向下滚动页面,并在页面末尾以完整宽度显示页脚. 我搜索了很长时间,但找不到有效的解决方案. 我希望有人能帮助我实现目标...

i'm designing a website with joomla and using the bootstrap framework. Now i have a problem by my footer. Basically i use a simple grid layout and i want the content part of the site in the center of the page with space on the left and the right side which i already achieved. And now i want the footer not in the middle like the content but on the end of the page and over the whole width of it and NOT FIXED. So i want normally scroll down the page and at the end of it the footer shall appear with full width. I searched for it a long time but i don' find any solution that worked. I hope somebody can help me to achieve it...

以下是我使用的php页和css文件的脚本

In the following are the scripts of the php-page and the css file i used

index.php

index.php

<!DOCTYPE html> <html> <head> <jdoc:include type="head" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <!-- main container --> <div class='container'> <!-- header --> <div class="mainMenuTop"/> <div class='row'> <jdoc:include type="modules" name="position-1" style="well" /> </div> <div class='row'> <!-- main content area --> <div class='span12'> <div class="article"> <jdoc:include type="component" /> </div> </div> </div> <!-- footer --> <div class='row'> <div class='span12'> <div class='footer'> <jdoc:include type="modules" name="footer" style="none" /> </div> </div> </div> </div> </body> </html>

style.css

style.css

body { overflow-y: scroll; background: url(../images/Test.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } .article { padding: 25px; margin-top: 30px; margin-bottom: 30px; border-radius: 18px; background: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255); /* The Fallback */ font-size: 12pt; font-family:"Calibri", Times, serif; } .footer { height: 50px; border-top: solid 1px black; }

亲切的问候, oodoloo

Kind Regards, oodoloo

推荐答案

您可以将页脚放在主内容容器之后,以<div class="container">分隔.然后,您可以分配一个不限制页脚宽度的容器类,就像主要内容一样.例如::

You can put your footer to separate <div class="container"> after the main content container. Then you can assign a container class which does not limit the width of the footer, like happens with main content. E.g.::

<div class="container"> ... </div> <div id="footer" class="container-fluid"> <div class="row">....</div> </div>

更多推荐

Bootstrap页脚,页面全宽

本文发布于:2023-11-23 04:12:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1620044.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:页面   Bootstrap   页脚

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!