html - 是否有一个简单的 html 代码可以在内容最少的页面底部添加页脚?(不使用 CSS)
问题描述
我希望找到某种在页脚标记中输入代码的方法(就像在我的示例中一样),以将页脚粘贴在底部而不是刚好在我的内容末尾下方。有没有办法在没有 CSS 的情况下做到这一点?抱歉,如果我的术语不正确,我几天前才开始学习 html。
<!doctype html>
<html>
<head><title> Sample Website </title></head>
<body>I want the footer at the bottom of the page</body>
<footer height="0">This is a footer test for a short page</footer>
</html>
解决方案
你可以用非常少的 CSS 来做到这一点..
footer {
height: 100px;
width: 100%;
position: fixed;
bottom: 0;
left: 0;
}
<footer>
This is a footer test for a short page
</footer>
或者您可以使用内联 CSS:
<footer style="height: 100px; width: 100%; position: fixed; bottom:0; left:0;">This is a footer test for a short page</footer>
推荐阅读
- laravel - laravel 来自单个查询的多个结果
- html - 让徽标出现在导航栏的右侧
- javascript - JS/Vue:如何为美国自动完成选择下拉菜单?
- swift4.2 - iOS 12 存在(fromrootviewcontroller)导致应用程序冻结
- python - 为什么 pd.Series([np.nan]) | pd.Series([True]) 评估为 False?
- javascript - 从php返回数组值(图像文件名到javascript)
- python - 如何最有效地计算矩阵乘积的对角线
- python - ruamel.yaml 倾倒浮动时的奇怪行为
- c++ - (C++)处理链表时返回-1073741819(0xC0000005),但算法有效
- ros - 大型室内凉亭环境