CSS 页脚宽度

标签 css drupal web footer

我使用 CSS 才几个星期。我正在使用 Drupal 重新创建一个网站。我在使用页脚时遇到问题,它不会扩展以适应屏幕(就像 stackoverflow 上的那样)。我希望能够缩小,它会扩展到整个网站。

我已经在网上浏览了大约两天,试图解决这个问题,此时我没有更多的想法可以尝试。

我的站点当前位于 DEV 服务器上,因此我可以访问所有文件。我认为我需要编辑的文件是 layout.css,但如果它在另一个文件中,请告诉我。

    /*
*   site-specific layout statements
*/
/*  Structure
-------------------------------------------------------------- */

body,html{
    margin:0px;
    padding:0px;
    background: #17293d url(../img/backgrounds/main_bg.gif);
}

#totalContainer{
    //margin-top:10px;
    //margin-bottom:10px;
}

.width_1#totalContainer{
    width:1038px;
}

.width_2#totalContainer{
    width:978px;
}

#topBar{
    margin:0px;
    padding:0px;
    float:left;
    width:100%;
}

#topBarContainer{
    margin:15px auto 15px auto;
}

.width_1#topBarContainer{
    width:1038px;
}

.width_2#topBarContainer{
    width:978px;
}

#topBarLink{ /* top toggle bar */
    text-align:center;
    margin:0px;
    padding:0px;
    height:10px;
    width:100%;
}

#topBarLink a{ /* top toggle bar */
    float:left;
    margin-left:48.5%; /* make it block level and try to center it without javascript..*/
    padding:15px 10px 5px 10px;
}

#topBarLink.withoutTopRegion a{ /* makes space in case we don't have any element in the top Region */
    margin-bottom:50px;
}

#top{ /* upper part of the template */
    float:left;
    width:101.2%;
    height: 84px;
    position:relative;
    /* margin-bottom:10px; */
    /* background: #black; */
}

#topUtility{
    position:absolute;
    top:13px;
    right:18px;
}

#logo-container{ /* image logo container */
    float:left;
    height:150px;
    margin-right:10px;
    margin-top: 0px;
}

#title-slogan{ /* site title and slogan container */
    float:left;
    margin-top:20px;
}

#site-title,
#site-slogan{ 
    margin:0px;
    padding:0px;
}

#search{ /* theme search box */
    position: absolute;
    right:0px;
    top: 30px;
}

#search div{ /* search button inline */
    display: inline;
}

//#pageBorder{ /* makes the border */
    //float: left;
//}

.ie7 #pageBorder{ /* for IE7 */
  float: none;
  overflow: hidden;
}

/*#contentWrapper{ /* wraps content */
/*  float: left;
    padding:15px 5px 15px 5px;
    position: relative;
    z-index: 1; /* follows the z-index order of primary menu and advertise (to solve ie7 z-index BUG )*/
/*}*/

.breadcrumb{ /* breadcrumb */
    padding-bottom: 5px;
    border-bottom: 1px dashed #ccc;
    margin:0px 10px 15px 10px;
}

#footer{ /* site footer*/
    margin-top: 25px;
    /* padding-bottom:60px; */
    float: left;
/*  width: 100%;*/
    min-width:100%;
    max-width:100%;
    position:relative;
    background:#000000;
    display: block;
}

#navigation-footer{ /* site footer*/
    position:absolute;
    right:0px;
    top:0px;
    background:#000000;
}

#bottomUtility{
    position:absolute;
    top:0px;
    right:0px;
}

/* utility menu */

.utility ul.menu{
    margin:0px;
    padding:0px;
    list-style:square;
}

.utility ul.menu li{
    display:inline;
    margin:0px 0px 0px 4px;
    padding:0px;
    list-style:square;
}

.utility ul.menu li a{
    padding-right:8px;
    list-style:square;
}

.utility ul.menu li:after{
    content:"|";
    list-style:square;
}


/*  Look & Feel
-------------------------------------------------------------- */

body.marinelli{
    background: #17293d url(../img/backgrounds/body.gif);
    /* background: #000; */
    height:125px;
}

#topBar,#topBarLink,#topBarLink a{ /* top toggle bar */
    //background:#054b81;
    background:#101518;
}

#topBarLink a{
    font-size: 1.1em;
}

.outsidecontent{
    color:white;
}

#site-title,
#site-slogan{
    font-weight: bold;      
}

#site-title{
    font-size: 3em;
    line-height:0.8em;
}

#site-slogan {
    font-size: 2em;
    text-indent: 0.5em;
}

#pageBorder{ /* border of the whole site */ 
    //border:10px solid #054b81;
    //border:10px solid #0c0c0c;
}

#pageBorder.noborder{ /* when we don't have the advertise region */ 
    border-top:0px;
}

#contentWrapper{
    //background: #17293d url(../img/backgrounds/main_bg.gif);

}

.breadcrumb { /* breadcrumb */
    font-weight: bold;
}

.utility{ /* utility menu */
    font-size:0.9em;
    //text-transform:uppercase;
    list-style:square;
}

最佳答案

这里的问题是您有一个用于布局的表格。表格通常只用于显示表格数据,而不是布局。表格的默认行为是缩小到它的内容(即,如果您的内容很小,它不会展开整个页面的宽度)。

如果您不能修改标记,您需要添加的是:

http://jsfiddle.net/Yx9JM/1/

#footer table {
    width: 100%;
}

关于CSS 页脚宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17240063/

相关文章:

powershell - powershell可以用作网络编程吗?

html - h1 前后有两条线和图像

php - Bootstrap - 容器流体的对齐问题

css - 在没有 htaccess/iis 的元素中使用自定义字体会导致 "Resource interpreted as Font but transferred with MIME type text/html"

Drupal:更新数据库中的文件系统路径

deployment - 最佳的 Drupal 部署策略是什么?

javascript - 适用于 Web 的 Firebase Analytics 调试 View

javascript - HTML 视觉对象无法正确呈现

css - SVG响应曲线线

jquery - jQuery 的解释是错误的吗?或者Drupal输出错误?