How do I always leave margin margin at the bottom of the page?


I have CSS in body :

margin-bottom: 20px;

But always buga, for example, if I use position: absolute; it loses this 20px margin. How to do this in other ways?

asked by anonymous 10.04.2014 / 22:30

3 answers


If the problem is with position absolute , use bottom: 20px . No longer this margin-bottom in body resolves.

10.04.2014 / 22:35

For absolute values, use the bottom property only.


.divTeste { position:absolute; bottom:20px; }


<div class="divTeste"></div>
10.04.2014 / 22:42

Verify by inspecting elements, if your body is 100% in height of the page, if the margin-botom: 20px is to function or also position: absolute; bottom: 20px;

Now if you do not inspect elements of your body is not 100%, then there is something wrong there on your page.

14.04.2014 / 15:38