Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS fixed div within container

Tags:

css

How do I have fixed div contained within a div.container, where the fixed div is ONLY fixed within the div.container (and not the rest of the page)? That means if I scroll down the page, outside of the container div, the fixed div does not scroll. It's hard to explain, see this example: http://jsfiddle.net/jg8qJ/

like image 724
atp Avatar asked May 20 '11 19:05

atp


1 Answers

give

.container { 
    position:relative; 
} 

and set

.info { 
    position:absolute; 
    top:0; 
    left:0;
}
like image 149
Jrod Avatar answered Oct 19 '22 02:10

Jrod