我有一个针对Google Chrome的CSS问题。我做了一些研究,但没有人知道如何在没有Javascript的情况下修复它,我不想使用它,因为我的元素将在未来发生变化。位置固定为页首的中心标题元素
代码如下,如果您使用它,您将看到子div移到页面的右侧,并且如果我将相同的顶部位置值添加到父项,则它将向相反的方向移动。
该网站将有更多的内容,我想要一个居中的标题,其中边栏和浮动内容将在您翻动页面时消失。
<body>
<!--this should not need any css coding till later on after the site is complete-->
<center>
<div class="header_p1">
<img class="header_p1_child" src="header.png"/>
</div>
</center>
和CSS是
.header_p1
{
background: white;
width: 750px;
height: 110px;
margin-bottom: 10px;
}
.header_p1_child
{
float: none;
background: white;
width: 750px;
height: 110px;
position: fixed;
top: 0px;
}
者均基于浮动属性不做任何事情反正我忘了把它拿出来与父母养育DIV为在那里,否则如果向下滚动页面soory它会消失,我没有说 – 2013-04-27 11:43:34