开发者

CSS fixed div within container

开发者 https://www.devze.com 2023-03-07 20:46 出处:网络
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 th

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/


give

.container { 
    position:relative; 
} 

and set

.info { 
    position:absolute; 
    top:0; 
    left:0;
}
0

精彩评论

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