sb0k
sb0k

Reputation: 47

fixed div with horizontal scroll css

I'm doing a horizontal layout and I want the header to scroll horizontally .. 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!!!

Upvotes: 2

Views: 11260

Answers (2)

peirix
peirix

Reputation: 37751

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

Upvotes: 3

Kobius
Kobius

Reputation: 714

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!

Upvotes: 3

Related Questions