html - header 位置 : fixed

标签 html css header fixed-header-tables

我想知道当我向下滚动时是否有机会在屏幕上保留一个固定的标题,我该怎么做?

我试图在 .header.dark 类中添加 CSS position: fixed; 但它破坏了模板。

感谢您的帮助。

最佳答案

应该可以正常工作。试试这个:

<div class="header">This is the header</div>

CSS

.header {
    position:fixed;
    width:100%;
    top:0;
    left:0;
    background:blue;
    z-index:999;
}

关于html - header 位置 : fixed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21916658/

相关文章:

php - 单击按钮时 SQL 更新表行

html - 使用 bootstrap 3 将 div 中的文本对齐到底部

javascript - jquery 找不到 firebreath 对象

php - 我有两个 php 文件,其中一个文件位于子文件夹内,我想转到 php 文件之外

c++ - msleep 在哪里声明?

html - 我可以在没有 bootstrap css 的情况下使用 fontawesome 图标吗?

html - Alt标签字体大小

javascript - Jquery 类名启动选择器在两种不同情况下不起作用

html - 如何覆盖现有 Django 表单的 css?

c++ - C++的多重定义。如何正确拆分C++程序?