Can you create div that doesn't scroll as page content
css, html
Solution
If you want something to stick to the screen use
position:fixed;
Like so:
div {
background-color:blue;
height:200px;
width:200px;
position:fixed;
bottom:0;
}
Demo: http://jsbin.com/owacaq/1/edit
Edit:
If you want something to stick to its parent use
position:absolute;
On the to be sticked element and
position:relative;
On the parent.
Position absolute doesn't respect anything except the next parent with position other than static.
Example
http://jsbin.com/eceqeh/1/edit
Problem
I'm not sure if this is possible or not: I have a webpage with several div's of content on it, stacked one on top of the other. At the bottom, of all the content div's, I want there to be a 100px tall image (or maybe it's a DIV with a `background-image`). When you view this page, the browser creates scrollbars so that you can scroll down the content but also so you can scroll the bottom div/image into view. Are there CSS settings I can use on that bottom div/image so that the browser basically ignores it as content? So that the browser doesn't try to scroll down to it? I can't figure out if this is possible or not. Alternatively, I can make the image part of the `<body>` background, but then how do I force this image to show up exactly below my content div's? When you change the window size, the height of my content div's change, due to changing content inside of them. So I'm not sure how you can always ensure this bottom image shows up exactly after the last content div if it's a background. UPDATE Here is a link that can help illustrate what I'm trying to do: http://jsbin.com/ojejad/2/edit When you scroll down, the green shows up, because it's obviously part of the content of the page. Is it possible for the browser to not consider the green div part of the page content, so that the scrolling stops at the bottom of the blue? The reason for this is that I want people to see the green image at the bottom only if their monitor is big enough that they natually see all the blue + the green without having to scroll. But if the user's monitor is too small, I don't want them to scroll to the bottom of the page and continue scrolling just to see this image because it's really supposed to be just a background image and not apart of the important content.