The footer is refusing to show up at the bottom of the page

Why is my footer floating in the middle of the page? It's driving me crazy. I really hope it's a quick fix. I've searched online and all the solutions point to having a fixed footer, but I don't want that because it looks bad on smaller screens.

<!DOCTYPE html>
<html>
<head>
    <title>MM Web Design</title>
    <meta name="viewport" content="width=500, initial-scale=1">
    <link rel="stylesheet" href="css/style.css" />
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800' rel='stylesheet' type='text/css'>
</head>
<body>
    <img class="logo" src="img/logo.png">
        <div class id="nav">
            <ul>
            <li>Contact</li>
            <li>About</li>
            <li>Work</li>
            <li>Home</li>
        </ul>
    <br>
</div>


<div class="wrapper">
    <h1>Welcome to my Portfolio</h1>

    <p>
        yada yada yada
    </p>

        <div class="row">
            <div class="side-bar">
                <h3> Recent Work </h3>
                <p>Here's some of my latest work, covering web design, branding and identity.</p>
                <a href="#">View the Portfolio &rarr;</a>
            </div>

        <div class="recent-wrap">
                <a href="#"><img src="img/body-metrix.png"></a>
                <a href="#"><img src="img/body-metrix-logo.png"></a>
                <a href="#"><img src="img/market.png"></a>
        </div>
        </div>

<div class="footer-wrap">
    <div class="footer">
        <ul>
            <li>Contact</li>
            <li>About</li>
            <li>Work</li>
            <li>Home</li>
        </ul>

        </div>
    </div>


</body>
</html>

CSS

.footer-wrap{
    height:50px;
    width:100%;
    background:#333333;
    margin: 0em;
}

.footer ul {
    font-size: 18px;
    font-weight: lighter;
    list-style-type: none;
    margin: 100px;
    padding: 0;
    text-decoration: none;
}

.footer ul li {
    float: right;
    display: block;
    padding-left: 20px;
    font-size: 0.75em; 
}

Answer №1

Chances are, the content is simply appearing below the other divs.

Have you considered using a sticky footer?

  <div class="page-wrap">

  Some Content Here!

  </div>

  <footer class="site-footer">
  This is the Sticky Footer.
  </footer>

Here's an example of the CSS code:

* {
   margin: 0;
    }
  html, body {
   height: 100%; 
  }
.page-wrap {
min-height: 100%;
/* must be equal to footer height */
margin-bottom: -142px; 
 } 
.page-wrap:after {
 content: "";
 display: block;
 }
.site-footer, .page-wrap:after {
 /* .push should match the footer's height */
 height: 142px; 
 }
 .site-footer {
 background: orange;
  }

Answer №2

Are the divs performing as expected and properly arranged? Once you add content to the previous div, the footer will automatically move down. To keep it at the bottom of the window, consider making it sticky as previously recommended.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Navigation Menu Dropdown Present on the Right Side and Arranged in a Horizontal Stack

I'm having trouble with a dropdown menu in my navigation bar. I followed the example on W3Schools but when I hover, the menu appears horizontally instead of vertically and to the far right of the page. I've searched for solutions but can't s ...

Obtaining numerous distinct array elements

I have created a form with checkboxes for users to select options. <input type="checkbox" name="rights[]" value="1" class="a"> A <input type="checkbox" name="rights[]" value="2" class="b"> B <input type="checkbox" name="rights[]" value="3" ...

AngularJS utilizes JSON objects to store and manipulate data within

My task requires accessing information from an array that is nested inside another array in Json format. Here's a more detailed example: [ { "id": 1, "name": "PowerRanger", "description": "BLUE", "connections": [ {"id": 123,"meg ...

Developing a unique attribute using AngularJS

As a beginner in AngularJS, I am experimenting with creating directives to manipulate the background-color of a <div> based on specific conditions. I aim to write code like this within my view: <div effect-color="#2D2F2A">content here</div& ...

Activate a pointer cursor when hovering over a TextField in Material-ui design

Hey there! I'm new to Material-ui/ReactJS and I have a question. I'm trying to change the cursor to a pointer when hovering over a Material-ui TextField, but it's proving to be quite challenging. The default behavior is 'cursor: text&ap ...

Personalizing Bootstrap 5 button designs and attributes for a customized look

In my project, I've set up my custom.scss file with the following code: $primary: #e84c22; $theme-colors: ( primary: $primary, ); @import "~bootstrap/scss/bootstrap.scss"; Currently, the color looks like this: https://i.sstatic.net/lbL ...

Has anybody dabbled with Indexed DB before?

After finding out that WebSQL is deprecated, I started exploring IndexedDB as an option for browser offline storage. However, I discovered that IndexedDB has undergone significant design changes since the examples provided in HTML5Rocks (http://www.html5 ...

How to utilize the reduce method with an array of objects in JavaScript

Every week, a number of objects are delivered to me. Each object contains information such as date, hours, and other fields. I need to arrange these objects in an array based on the total hours for each day. Here is an example of the objects: var anArray ...

CSS Tricks: Placing a Panel Just Off the Page Edge

Having difficulty adjusting a panel slightly off the page like this: click here for image Attempted using width: 120% While it does work, resizing causes the image to move from its original position. I want it to remain consistent on different screens. ...

Experimenting with HTML and CSS to enhance email presentation

I am currently developing a Django application that requires sending out Emails with HTML templates. These email templates include images and dynamic variables from the Django context. However, each time I make changes to the inline CSS or HTML, I have t ...

Disorganized jQuery Animation

Looking for some help with an animation I have on my website. The animation is supposed to smoothly move in and out when the mouse cursor hovers over it, but as you can see, it's a bit messy. This project involves HTML, CSS, and jQuery <!DOCTYPE ...

Small jumps occur when implementing the scrollTop jquery animation

I've encountered an issue with the scrollTop jquery animation that I can't seem to resolve. It seems to micro-jump right before the animation, especially when there is heavier content. I'm puzzled as to why this is happening... Here's ...

Using Svelte to effectively connect to a specified object within an array

Check out this code snippet: <script> let data = [ {id: 1, first: "x"}, {id: 2, second: "y"} ]; </script> <input type="text" bind:value={data.first}/> If you modify the value in the input field and ...

Icon appearing outside the button instead of inside

Here's a button I'm working with: <button class="glyphicon glyphicon-option-horizontal" (click)="myFuncion()"></button> Recently, I updated my bootstrap library from version 3 to 4.2.1 and now the icon is no longer visible. I' ...

Embeddable video player failing to adjust size properly within parent div

I've been tackling the challenge of making iframes responsive within a div element, but I've hit a roadblock. While there are plenty of solutions available online, none seem to work seamlessly when dealing with YouTube video embeds. Currently, m ...

Optimizing VueJS applications with browser caching features for faster loading

I've encountered an issue with my VueJS app. After running npm run build, a new set of dist/* files are generated. However, when I upload them to the server (replacing the old build) and try to access the page in the browser, it seems to be loading th ...

Word.js alternative for document files

I'm on the lookout for a JavaScript library that can handle Word Documents (.doc and .docx) like pdf.js. Any recommendations? UPDATE: Just discovered an intriguing library called DOCX.js, but I'm in search of something with a bit more sophistic ...

Switch between two fields using just one animation

I've been experimenting with creating an information tag that slides out from behind a circular picture. To achieve this effect, I created a block and circle to serve as the information field placed behind the image. However, I'm facing a challe ...

Why does CSS work on Localhost but not on the server in IE?

I recently faced a bizarre issue. After designing a website using CSS3, I uploaded it to the server only to discover that most of the features are not supported by IE8, making the site layout unrecognizable. Even more strange was the fact that IE8 display ...

Creating a responsive card design with Material UI

Creating a responsive card layout for mobile applications is my current challenge const styles = { edit: { width: "40%", marginLeft: 270, background: "#76ff03" }, add: { width: "100%", background: "#18ffff", size: "large" ...