CSS页脚栏底部中心问题

标签 css

大家好,我试图让我的底部栏在屏幕上居中,但我做不到。

<style type="text/css"> 
body {
background: #fffff;
margin: 0;
padding: 0;
font: 10px normal Verdana, Arial, Helvetica, sans-serif;

}

* {margin: 0; padding: 0; outline: none;}

#bottomBar {
position: fixed;
bottom: 0px;
left: 0px;
z-index: 9999;
background: #e3e2e2;
border: 1px solid #c3c3c3;
border-bottom: none;
width: 500px;
min-width: 500px;
margin: 0px auto;
-moz-opacity:.90;
filter:alpha(opacity=90);
opacity:.90;
}

*html #bottomBar {margin-top: -1px; position: absolute;     top:expression(eval(document.compatMode &&document.compatMode=='CSS1Compat') ?documentElement.scrollTop+(documentElement.clientHeight-this.clientHeight) : document.body.scrollTop +(document.body.clientHeight-this.clientHeight));} 
#bottomBar ul {padding: 0; margin: 0;float: left;width: 100%;list-style: none;border-top: 1px solid #fff;}
#bottomBar ul li{padding: 0; margin: 0;float: left;position: relative;}
#bottomBar ul li a{padding: 5px;float: left;text-indent: -9999px;height: 16px; width: 16px;text-decoration: none;color: #333;position: relative;}
html #bottomBar ul li a:hover{  background-color: #fff; } 
a.PDF{background: url(http://www.xxx.com/img/pdficon.png) no-repeat center center;   }

</style>

<div id="bottomBar"> 
<ul id="mainpanel">     
    <li style="padding-top:5px; font-family:Arial, Helvetica, sans-serif; padding-left: 5px;">First time here? Be sure to check out the "this" button above or download the PDF here -></li> 
    <li><a href="http://www.xxx.com" class="PDF">Download PDF <small>Download PDF</small></a></li>   
</ul> 
</div> 

谢谢!

大卫

最佳答案

好的,我通过将它添加到我的 CSS 中得到了它:

left:0;
right:0;

关于CSS页脚栏底部中心问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2716760/

相关文章:

html - 为什么包装器元素会自动增加?

javascript - JQuery scroll()/scrollTop() 在 IE 或 Firefox 中不工作

html - CSS3 和 HTML5 ;过渡不起作用

css - React 中使用 Flex 的全高

html - 在同一行中并排对齐文本字段和按钮

jquery - 滚动时 jQuery 的 .fadeTo 问题

javascript - 当用户选择他/她的文件时更改文件输入按钮的文本

javascript - 如何将图片菜单滑动为跑马灯

javascript - 背景滚动内容并坚持到顶部

javascript - 单击大图时图像不会加载