中心和固定头

问题描述:

我的工作我的投资组合:www.bbellmedia.com/mywork中心和固定头

我想要的文字“布莱恩贝尔为中心是怎么回事,但也可以固定,当用户滚动。

达到此目的的最佳方法是什么?

非常感谢!

+0

如果你没有在问题中包含你的CSS(而不是链接),这将永远不会帮助其他人。 – 2012-07-13 00:34:32

+0

@GeorgeStocker我意识到现在,这是一个n00b错误。我会添加它。 – brybell 2012-07-13 01:51:06

+0

@wesleymurch我想为别人添加CSS来查看,但你关闭了它:[ – brybell 2012-07-13 01:53:24

#header { 
    position:fixed; 
    text-align:center; 
    width:100%; 
} 

,如果你想要的图像不会在你的标题,用这个

.header { 
    .... 
    position: fixed; 
    top: 0px; 
    width: 100%; 
    background-color: black; 
    z-index: 300; 
} 

.app1{ 
    margin-top: 184px; 
} 
+0

所以这会让它在标题下而不是在顶部? – brybell 2012-07-13 01:08:18

嘿,现在习惯了这种CSS * 样式表 *

.header到给position fixed,现在给left 0right 0top 0并给z-index maximum

.header { 
    left: 0; 
    position: fixed; 
    right: 0; 
    text-align: center; 
    top: 0; 
    z-index: 999; 
}