作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
如果您只需要担心 Firefox 和 Webkit 浏览器,您会使用什么 CSS 使以下 HTML 中的页脚固定在页面底部? 注意:我不想向页面添加任何标记。
<html>
<body>
<header>...</header>
<article>...</article>
<aside>...</aside>
<footer>...</footer>
</body>
</html>
最佳答案
只需将位置设置为固定并将 bottom 设置为 0:
footer
{
position:fixed;
bottom:0;
}
在 FF、IE7、IE8 等中对我来说是一种享受。这是我在我的一个网站上用于页脚的实际 CSS(一个 id 为 footer
的 div):
#footer
{
clear:both;
color:#FFF;
background:#666;
bottom:0;
border:solid 1px #333;
height:30px;
width:100%;
min-width:950px;
position:fixed;
z-index:100;
}
关于css - 使页脚贴在页面底部而没有多余的标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3150436/
我在获取附加 Bootstrap 导航栏以在页面滚动时正确调整其宽度时遇到问题。 我希望导航栏在页面滚动时保持其包含元素内部的宽度,或者占据页面的整个宽度(从左到右开始) 我做错了什么,或者我需要做什
所以我正在尝试创建一个布局,其中我有一个带有卡片的页面,右侧有一张摘要卡片,在我滚动时会 float 。一种典型的词缀对象,以前在 bootstrap 中见过。到目前为止,这是我的尝试: 出于某种原因
我是一名优秀的程序员,十分优秀!