Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 拉伸横幅,并将页脚居中_Html_Css_Footer_Banner - Fatal编程技术网

Html 拉伸横幅,并将页脚居中

Html 拉伸横幅,并将页脚居中,html,css,footer,banner,Html,Css,Footer,Banner,我试图垂直拉伸我的垂直侧横幅到页面底部,并使左下角的页脚位于底部中心。我一直在寻找解决这个问题的办法,但到目前为止还找不到。我这样做是为了完成一项学校作业,因此,我仍在学习过程中。如果可以的话,请解释需要做什么来解决这个问题。谢谢 HTML: 这就是站点中出现的问题: 欢迎光临!在jsfiddle.com这样的网站上模拟这样的前端问题是很典型的,这样其他用户就可以很容易地看到你在说什么,并帮助你找到解决方案 如果我没弄错的话,这是你的解决办法。您只希望横幅是浏览器窗口的高度,对吗 我刚刚将.ba

我试图垂直拉伸我的垂直侧横幅到页面底部,并使左下角的页脚位于底部中心。我一直在寻找解决这个问题的办法,但到目前为止还找不到。我这样做是为了完成一项学校作业,因此,我仍在学习过程中。如果可以的话,请解释需要做什么来解决这个问题。谢谢

HTML:

这就是站点中出现的问题:


欢迎光临!在jsfiddle.com这样的网站上模拟这样的前端问题是很典型的,这样其他用户就可以很容易地看到你在说什么,并帮助你找到解决方案

如果我没弄错的话,这是你的解决办法。您只希望横幅是浏览器窗口的高度,对吗

我刚刚将
.banner\u h
的高度设置为100%,如下所示:

.banner_h {height:100%;}
#footer {width:100%; text-align: center;}

这可能会帮助您将以下css样式-

.banner_l{
    float: left;
    border:thin solid #000; 
    width:200px;  
    position:fixed; 
    height:auto; 
    min-height:380px; 
    margin-top:-20px;
}
.banner_r{
    float: right;
    border:thin solid #000;
    margin-top:-20px; 
    width:200px; 
    min-height:380px; 
    height:auto; 
}

#footer {
width:100%;
height:30px; 
background:#090; 
float:left; 
position:fixed;
padding:5px; 
bottom:0px; 
text-align:center; 
}

根据需要将位置样式更改为相对或绝对。

啊,谢谢,但我想你是指.banner\l和.banner\r。这就像是一种享受,但是页脚的位置呢?有什么方法可以放在页面底部,居中吗?下次我会上传JFiddle,谢谢你的提示@Jokan当然,很抱歉我错过了你问题的那一部分。我用页脚居中更新了我的答案,这是更新后的小提琴。啊,背景页脚功能非常好,谢谢!让我知道如果你需要任何帮助,我感谢你对学校的贡献。
.banner_h {height:100%;}
#footer {width:100%; text-align: center;}
.banner_l{
    float: left;
    border:thin solid #000; 
    width:200px;  
    position:fixed; 
    height:auto; 
    min-height:380px; 
    margin-top:-20px;
}
.banner_r{
    float: right;
    border:thin solid #000;
    margin-top:-20px; 
    width:200px; 
    min-height:380px; 
    height:auto; 
}

#footer {
width:100%;
height:30px; 
background:#090; 
float:left; 
position:fixed;
padding:5px; 
bottom:0px; 
text-align:center; 
}