html - 页脚不会居中

标签 html css footer

我有点知道,所以我不知道我的格式是否正确,但我的问题是:如何将页脚居中到页面中间(当然是垂直的)?

<!-- Header & footer-->
 <header>
 <style type="text/css">
  body {
  font-family : Verdana, Helvetica, Geneva, SunSans-Regular, sans-serif, arial ;
background-color: #C2A366;
 margin-top:0px;
 margin-bottom:0px;
margin-right:0px;
margin-left:400px;
}
p.padding
{
padding-top:0px;
padding-bottom:0px;
padding-right:50px;
padding-left:0px;
}
</style> 
</header>

<footer><table align="center">
<tr><td align="left"><p class="padding"><font color="white">Phone: 555-555-1800<br>Fax:         555-555-1800<br>Canada:1-800-555-5555<br>Mexico:001-800-555-5555</p></font></td>
<td align="left"> <p> <font color="white"> company title<br>Street<br>City, State         zip<br>
  <a href="mailto:emailadress@host" style="text-decoration:none"> <font color="white">     email adress</a></p></font></td></tr>
  </table><table align="center">
  <tr><td><p class="padding"><font color="white" font size="2"> copy write 2014     yatayata </tr></td>
 </table> </footer>
</html>

最佳答案

垂直居中有几种方法..这是其中之一。检查 DEMO 首先。

html, body {
    width:100%;
    height:100%;
}
html {display:table;}

body {
    display:table-cell;
    vertical-align:middle;
   font-family : Verdana, Helvetica, Geneva, SunSans-Regular, sans-serif, arial ;
background-color: #C2A366;
}
p.padding
{
padding-top:0px;
padding-bottom:0px;
padding-right:50px;
padding-left:0px;
}

关于html - 页脚不会居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23882839/

相关文章:

java - 单独文件中的页脚操作

jquery-handsontable : passing a function to colWidth option

html - 如何在没有 id 或 class 的情况下更改 CSS 样式

html - 如何在滚动时将页面内容隐藏在具有透明背景的div后面

css - 颜色型号名称

html - 调整大小时在页面中 float 的粘性页脚(重新询问)

css - 页脚问题

javascript - 基于 Node.js + Node-Webkit + Node-SerialPort 的应用程序 - 这可能吗?

javascript - 将 onhover 更改为 onclick

javascript - CSS/JS 用户控制的阴影效果