Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make the footer stretch vertically?

Tags:

html

css

footer

I have a footer that is a 1 x 70px, which is set as the background and tiles horizonally.

In cases when the web page does not contain a lot of content on it, it will display the footer above where the footer should be. I want it to fill in with a solid color, so if they scroll down, it won't show the footer, then the white under the footer.

Here is the style I have for the footer.

.footer{
    background:#055830 url('/images/footer_tile.gif') repeat-x top left;
    color:#fff;
    font-size:12px;
    height: 70px;
    margin-top: 10px;
    font-family: Arial, Verdana, sans-serif;
    width:100%;
}

alt text

I want the footer to look like this: alt text

like image 799
Brad Avatar asked Jun 02 '26 03:06

Brad


2 Answers

Please clarify - do you want solid green at the bottom? If so, just set a green background for body...

body {
    background-color:#060;
}

That should give you the result in your second screenshot. Change the color to match the bottom of your gradient image.

If you want the foot pegged to the bottom, use the absolute positioning mentioned, and set the background to match the top of the gradient image.

like image 147
Chris Marasti-Georg Avatar answered Jun 03 '26 17:06

Chris Marasti-Georg


You could change your body style so that the footer blends in.

body {

background: rgb(173, 173, 173);
}
like image 34
Ken Penn Avatar answered Jun 03 '26 15:06

Ken Penn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!