CSS固定标题 [英] CSS Fixed Header

查看:99
本文介绍了CSS固定标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试修正顶部的标题。我已经看过其他帖子,并确定我做得对。这是头部的CSS:

I am trying to fix my header on the top. I've looked at other posts and am sure that I'm doing it right. This is the CSS for the header:

.header{
    width: 100%;
    position:fixed;
    top: 0px;
}

由于某些原因,当我这样做时,标题消失。任何想法为什么?我应该如何更改代码?
FYI我使用引导程序并将其添加到它中。

For some reason when I do this, the header disappears. Any ideas for why? And how should I change the code? FYI I'm using bootstrap and adding this into it.

谢谢你,Stefan

Thanks a ton, Stefan

看到这样的答案后,我做了编辑,但它又一次消失在我身上。我使用的CSS是:

After seeing so answer I made so edits, but it disappeared on me again. The CSS I am using is:

position: fixed; 
width:960px;

再有帮助吗?真的很感谢。

Anymore help? Really appreciated.

推荐答案

固定不是修正

.header{
     width: 100%;
     position:fixed;
     top: 0px;
}

这篇关于CSS固定标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆