无法定位页脚CSS
下面是制作页脚的教程,但结果并不像预期的那样: 我的html和css在这里 或以下:无法定位页脚CSS,css,footer,Css,Footer,下面是制作页脚的教程,但结果并不像预期的那样: 我的html和css在这里 或以下: <body> <div class="wrapper"> <div id="container"> <div id="header"> <div class="wrap"> <div id="menuProfile"> <div id="logo
<body>
<div class="wrapper">
<div id="container">
<div id="header">
<div class="wrap">
<div id="menuProfile">
<div id="logotext">K-Panel • Kerio Tools Management</div>
</div>
</div>
</div>
<div class="fix"></div>
<div id="subheader">
<div id="submenu" class="wrap">
<div id="logocliente">
<a href="<?php echo $this->baseUrl(); ?>/"><img height="50"
id="logoIscrittoTestata"
src="<?php echo $this->baseUrl(); ?>/KPanel_logo_2014_58x224.png"></a>
</div>
</div>
</div>
<div class="fix separatore"></div>
<div id="page">
<div id="right">
</div>
</div>
<div id="push"></div></div>
<div id="footer">
<strong>Freelands</strong> > Via Emilia Ponente, 479, 40132 Bologna (Italy) > Tel +39 051 7402558 > Fax +39 051 729153 > C.F. e P.IVA 03236491209 > <a
id="footerEmailAzienda" href="mailto:info@freelands.it">info@freelands.it</a>
</div>
您需要添加一个
位置:固定代码>到页脚,使其保持固定。要使其保持在底部,请添加一个bottom:0代码>
代码更改:
#footer{
font-size: 12px;
font-family: calibri, gill sans, arial;
color: black;
text-align: center;
width: 100%;
position:fixed;
bottom:0px;
}
希望这有帮助。对于将页脚粘贴在底部,您需要将其设置为位置:固定底部:0代码>并添加页边距顶部:(页脚高度)代码>
如果您正在寻求帮助,为什么不说明您实际遇到的问题是什么?您有很多包装问题。我建议的第一件事是去掉一些看起来有点无关的包装和容器。然后添加一个z-index
,使其相应地调整。-@Christophy你误解了…实际上不需要固定位置和z索引…好吧,我如何才能正确表达它。您的解决方案使用位置:固定
。这很糟糕。不要这样做。现在明白了吗?但是他提到的链接和他想要实现的输出是可以实现的,只要位置固定。。我听起来清楚吗@Christophlet为什么你们这么痴迷于固定位置?它很混乱,容易出错,绝对不需要……你能解释一下它是怎么搞砸的,这样我就知道应该遵循什么标准吗?看看我和内森的讨论,我在那里解释了问题
#footer{
font-size: 12px;
font-family: calibri, gill sans, arial;
color: black;
text-align: center;
width: 100%;
position:fixed;
bottom:0px;
}
#footer {
background-color: #0082C0;
color: #FFFFFF;
padding-top: 15px;
position:fixed;
bottom:0;
margin-top:30px; /* height of the footer */
}