I'm trying to push my background content image and make it stick to bottom of my page. The image is NOT a footer since the image will be behind some of the content. But the image shouldn't get cut off at the top when there is little content and and should stick to the bottom when there is loads of content!
Nothing working quite yet. Anyone got any tips for me?
Here are two examples. One with content fitting the window and the other with a lot more content.
Here are two links;
http://www.andrewa.org/testing/mosaik-test/content-imagebottom-test.html
http://www.andrewa.org/testing/mosaik-test/content-imagebottom-test2.html
Thank you in advance folks!
background-position takes two arguments, an x-value and an y-value so to position it at the bottom, you would use: background-position: center bottom; .
Add min-height: 100% instead of the height: 950px , that will give your div the height necessary. Second, use position:fixed to lock the background image at the same place (for scrolling).
you can try position:fixed css style. That will fix your picture regardless you maximize or minimize the screen. Hope it will help. And by this if user will resize window, he will not be able to see image..
The most common & simple way to add background image is using the background image attribute inside the <body> tag.
I would put the image as a background to the body
using background-attachment: fixed;
and add:
html, body {
height: 100%;
}
So the total would be:
html, body {
height: 100%;
}
body {
background-image: url("images/bg_content.gif");
background-position: center bottom;
background-repeat: no-repeat;
background-attachment: fixed;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With