Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I put white space at the bottom of my website, so the floating div never overlaps

Tags:

css

I found a lot of questions on stack overflow about getting rid of white space, but I can't seem to figure out how to put it in.

I have a bottom navigation on my site that floats with the page, but if the window is small, the bottom part of the page gets covered up. I would like to insert some white space at the bottom, so when the window is smaller than the length of the page you can still read it.

I've tried adding:

margin-bottom: 50px;
padding-bottom: 50px;

to the div containing the top page content, but it doesn't work.

Is there something I am missing? Here's a demonstration: http://www.writingprompts.net/name-generator/

like image 910
Jeremy Avatar asked Apr 20 '12 16:04

Jeremy


People also ask

How do I put white space at the bottom of my website?

Using <br> Tag to Create Space in Text or Line Inserting an extra space beneath text or line is pretty easy, it can be achieved using <br> HTML tag. This tag can break any text and create extra space, check out the examples below. BR tag Output: Check out the br tag example below.

How do you make footer not overlap content?

How do I get my footer to stay at the bottom of content? Keep the footer at the bottom by using Flexbox Make sure that you are wrapping everything in a <div> or any other block-level element with the following CSS styles: min-height:100vh; display:flex; flex-direction:column; justify-content:space-between; .

How do I create a white space in a div?

Just enter &nbsp ; inside your spacer div, but without the space before the semicolon. Alternatively, you could use break tags (<br>) to fill in the space, or a transparent spacer image set to the height you need.


1 Answers

#left, #right { 
    margin-bottom: 90px; 
}

or

#top_section > div { 
    margin-bottom: 90px; 
}

It doesn't work on #top_section because you use absolutes and therefore the content actually over extends the div itself, but trust me, either of those two css' i gave you WILL work

like image 174
SpYk3HH Avatar answered Sep 21 '22 14:09

SpYk3HH