开发者

fixed div with horizontal scroll css

I'm doing a horizontal layout and I want the header to scroll hor开发者_如何学Cizontally .. I show you an example of code css.

body {  
    background-color:#fff;  
}

#container {  
    margin:30px auto;  
    width:3000px;  
    height:700px;  
    border:1px dotted #ccc;  
}

#header {
    position:scroll;  
    margin:20px 20px;  
    width:200px;  
    height:70px;  
    border:1px dotted #999;  
}

thank you

Edit:

yeah..thank you so much..problem solved!!!


There is no position:scroll, what I'm guessing you're looking for is position:fixed for your header, but be aware that this won't work for IE6, though.

A small sample to show you: http://jsbin.com/ihuma3/edit


Simple solution, really: You just need to change your "position:scroll;" to "overflow:scroll;".

To make this only scroll horizontally, change it to: "overflow-x:scroll;".

Hope that helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜