View Full Version : question about setting a footer background image

01-30-2012, 10:33 AM
i have an image i want to set up as the background for the footer but i have to set the margin-bottom to -40px for it to be all the way at the bottom of the screen... will i run into any problems for making it negative? or is this fine?

01-30-2012, 10:38 AM
will i run into any problems for making it negative? Why don't have a try?

01-30-2012, 02:06 PM
ok so your telling me if it works it works,if it looks how i want it to then its good?

thats great common sense but it's not what im asking here

what im asking is ...
Is it BAD PRACTICE to use negative margins for things like this?

THANKS in advance for any replys :cool:

01-30-2012, 04:42 PM
moreover depends on how your footer is set up... it is weird to me that you need to set that at all... how are you setting up your footer? if your footer is set up correctly then all you should need to do is set the footer div background to your image- there should be no need to set negative margin.

If you are setting up your footer like as something like this...

margin-bottom: -40px;
height: 40px;


<div class="wrapper">
<div class="footer">

then that is an acceptable way to set up a footer

01-31-2012, 01:07 AM



<div id="footer">
<div id="footerbg"></div>

yea thats how i set it up but i used ID instead of class since im only useing it once

01-31-2012, 06:01 AM
There's nothing wrong in using a negative margin and there's no general rule related with margins and backgrounds.

Always test the output in some standard browsers like FF/Chrome/Safari etc and in some other browsers like IE8/9/10 ;), to make sure that it's okay.