0

following this question:
Float left and text-align center
I tried to create a mini-register bar on the left corner of the page and combine the body of the page on the same line as the mini-register bar.
So I've used kei's answer to improve my code using position:absolute but it takes all the body up, even the unneeded content (footer, for instance).
DEMO
As you see the class footer goes up and I want it stay down, I tried use position:fixed or position: initial.

Thanks in advance.

Community
  • 1
  • 1
rolory
  • 362
  • 1
  • 2
  • 15

2 Answers2

2

Try including 'clear:both' in your css for footer..

As you said you have used float:left, and if you may have used float:right for some other display purpose, there must be a gap left in between which takes your body part up.

clear:both can help in such situation.

Deepika
  • 331
  • 2
  • 7
  • 20
  • `clear:both` just makes the menu go lower, but not as expected. – rolory Mar 21 '14 at 17:31
  • I just edited one of my css for footer, display:block made the difference there, after removing it my footer went up just below the header. Ummmm try including 'display:block' along with clear:both . Hopefully it may work. – Deepika Mar 21 '14 at 17:42
  • `display:block` doesn't change anything – rolory Mar 21 '14 at 19:07
0

I am not clear with your problems but if the issue is you want to keep the footer at the bottom of the screen all the time. You can use this css

#footer {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
}

Just in case, you do not want footer to be present on the screen all the time but should be visible on the screen after user scrolls the page to the bottom, then you can use this CSS Sticky Footer Code

Let me know if it does not solve your problem.

Sachin Jain
  • 21,353
  • 33
  • 103
  • 168
  • It does not work. all the page messed up, the menu defines itself heights and widths values. About my problem - I want the footer will be at the bottom of the screen, yes, but not all the time. Only at the bottom. Thanks! – rolory Mar 21 '14 at 17:34