Facebook如何将该工具栏保留在页面底部?

时间:2009-07-31 21:14:27

标签: javascript css ajax toolbar

我喜欢Facebook如何将该工具栏保留在页面底部。

这是否需要跨浏览器的忍者技能?

他们的JavaScript / CSS文件非常庞大,因此我很难缩小实施范围(出于学习目的)。

4 个答案:

答案 0 :(得分:8)

您可以达到效果with CSS

答案 1 :(得分:4)

这是一个基本的例子。不,它不需要跨浏览器忍者技能。 =)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Facebook Bar</title>
<style type="text/css">
body {
margin: 0px;
padding: 0px;
overflow: hidden;
}
#page {
margin: 10px;
overflow: auto;
height: 93%;
}
#bottom {
width: 100%;
background: #18f8f8;
text-align: center;
}
</style>
</head>
<body>
<div id="page">
    Other stuff on page
</div>
<div id="bottom">Bottom stuff goes here</div>
</body>
</html>

答案 2 :(得分:1)

最好安装Firebug,看看他们是如何做到的。当我在网上看到有趣的东西时,Firebug是分析它的HTML结构,附加CSS的最佳方式,你甚至可以直接修改CSS / HTML结构来看它是如何变化的。您在网站上看到的所有内容都可以简单阅读。请记住,源(HTML,CSS,JavaScript)随之提供:)

答案 3 :(得分:0)

对于内容超出浏览器窗口底部的网页,该解决方案效果不佳。

尝试这样的事情:

<div style="display: block;
position: fixed;
text-align: center;
    z-index:1000;
bottom: 0;
left: 0;
width: 100%;
color: #999999;
clear: both;
height: 15px;
border-top-style: solid;
border-top-width: 1px;
border-top-color: #b5b6b5;
background-repeat: repeat-x;
border-right-style: solid;
border-left-style: solid;
border-right-width: 1px;
border-left-width: 1px;
border-right-color: #b5b6b5;
border-left-color: #b5b6b5;
background-color: #e7e7e7;"></div>