2013-10-17 15 views

回答

1

例如 http://jsfiddle.net/gvMLS/

HTML

<div id="header"> 
    </div> 
    <div id="content"> 
     content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/>content<br/> 
    </div> 

CSS

#header { 
position: fixed; 
top: 0; 
height: 20px; 
width: 100%; 
background-color: #ff0000; 
} 
#content { 
position: absolute; 
top: 20px; 
bottom: 20px; 
width: 100%; 
background-color:#fff; 
overflow: auto; 
} 
+0

谢谢!虽然我可能没有解释得那么好。我指的是文本“我们是他们的代理商,我们做品牌和主题”背后的背景图片,以及它如何在下面的内容流动时保持固定。那有意义吗?对不起,如果我没有正确解释它。感谢您及时的回复。 – kdipaolo