Click here to Skip to main content
15,918,193 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Basically I have made a footer with a black background. I have 3 Col-4's in it with various info in them. On the desktop it looks fine, but on mobile, the columns stack, which I want. When they stack the footer doesn't go further so it has a large white section underneath. I was wondering if anyone could take a look and suggest something. The codes probably messy, as i am a newbie.

HTML
<!-- css
CSS
#footer {
	height: 200px;
	position: absolute;
	bottom: 0;
	background-color: #000000;
	width: 100%;

}





}


HTML
HTML
 <footer>
      <div class="container-fluid">
      <div class="row">
 <div class="col-sm-4 col-md-4">
<br>
<br>
Home<br>
Services<br>
Gallery<br>
About<br>
Contact
 </div>
  <div class="col-sm-4 col-md-4">
      <aligncenter>Check Out Our Other pages</aligncenter><br>
      <aligncenter2><img src="Facebook-icon.png" width="50" height="51" alt=""/><br>
    <img src="YouTube-icon-full_color.png" width="50" height="36" alt=""/><br>
    <img src="new-instagram-icon-topic.png" width="50" height="48" alt=""/></aligncenter2>
 </div>
 <div class="col-sm-4 col-md-4">
      <div class="container-fluid" <br>
<br>
<alignright>
Registered office<br>

14 Stott Court<br>

Tweedmouth<br>

Berwick-Upon-Tweed<br>

Northumberland<br>

TD152YP
</alignight>
      </div>


-->
Posted
Updated 23-Sep-16 4:04am
v3
Comments
David_Wimbley 23-Sep-16 8:57am    
Can you post the complete footer HTML? I pasted it into VS and it is missing closing tags, you've got some tags mispelled so it doesn't know it has been closed, and I don't know what aligncenter elements are...not sure if thats something you've made or what but there is a lot of unknowns here.

1 solution

The problem is, you've set the height of the footer element to 200px.

When the columns stack, their combined height increases beyond 200px. The background stops at 200px, because that's the height of the footer element. But the content overflows the footer element, because you haven't told it not to.

Example 1 - height[^]

To fix it, you can either use a media query to change the height when the columns stack, or replace the height property with min-height.

Example 2 - min-height[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900