How do I keep my footer at the bottom of the page without it coming up automatically to fill space if there is little content?

StackOverflow https://stackoverflow.com/questions/19599204

Question

I'm building a website for our church and I'm using joomla 2.5 to do so. The template i used was wsnone2. I know a bit of code but not a lot i've tried to play around to sort out this issue but i cant seem to do it. Basically when there is very few lines of text as here http://www.smass2.co.uk/index.php/en/hymns/annual/deacon-responses/liturgies the footer comes up and covers the space. How do i stop that without making the position fixed. i tried using ryanfait sticky footer, and several others, but that didnt seem to work. can anyone people provide me with any more suggestions? if possible could the solution be done through CSS?

Thanks.

Was it helpful?

Solution

Actually, this is going to be harder than it looks at first glance. You have a couple things working against you here. First, your footer is actually contained in 2 divs, region9wrap and region10wrap. Doing as @gartox suggests will only move part of the footer to the bottom of the page. You would also need to do the same for the other part. To do so you would need this CCS -

.region9wrap {
color: #999;
position: fixed;
left: 0px;
bottom: 30px; /* height of div below*/
width: 100%;
}
.region10wrap {
color: #999;
position: fixed;
left: 0px;
bottom: 0px;
height: 30px;
width: 100%;
}

That will move both parts of the footer down, but now you will have a huge dark stripe where your background does not extend to the footer. Now you have to fix the background. First you need to remove the background from region4wrap completely.

Then add the background to the body tag -

body {
background: url('http://www.smass2.co.uk/images/Cross.jpg') no-repeat #0D0D0D;
}

This will make the background extend all the way down to the footer of the page without causing a big dark stripe.

OTHER TIPS

You need do this:

In the class .region10wrap add this properties:values

.region10wrap
    color: #999;
    position: fixed;
    left: 0px;
    bottom: 0px;
    height: 30px; /* your height footer*/
    width: 100%;
}

Easiest way to do this is to have the footers background on the actual page (behind the whole site), so when the footer can't reach the bottom, it will look like it's stretching all the way down.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top