Struggling to keep my footer anchored to the bottom of the page

Having some trouble while learning CSS & HTML - my footer won't stick to the bottom, it seems to float above with space below it (like a margin is present even though it's not). I've tried various online tips but most either don't work or mess up the header when the window is resized (placing it in the middle, etc).

Below is the HTML code:

<!DOCTYPE html>
<html>
<head>
    <title>Authorized Retailers</title>
    <meta charset="utf-8">
    <link rel="icon" type="image/png" href="photos/adidas.png">
    <link rel="stylesheet" type="text/css" href="css/stores.css">
    <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
</head>
<body>
    <!-- Header Section -->
    <header class="tm-header">
        <div class="tm-container">
            <a href="index.html"><img class="tm-logo"src="photos/adidas.png" width="80px" height="" alt="logo"></a>
            <nav class="tm-nav">
                <ul>
                    <li class="hover_menu"><a href="index.html">Home</a></li>
                    <li class="hover_menu"><a href="about.html">About Us</a></li>
                    <li class="current_page"><a href="#">Authorized Retailers</a></li>
                    <li class="hover_menu"><a href="services.html">Services</a></li>
                    <li class="hover_menu"><a href="contact.html">Contact</a></li>
                </ul>
            </nav>
        </div>
    </header>

    <!-- Content Section -->
    <div class="tm-container">
        <div class="tm-content">
            <section>
                <article>
                    <h1 style="text-align: center; font-size: 50px;">Our Authorized Retailers</h1>
                    <div>
                        <span class="stores"><a href="https://www.superge.si/" target="_blank"><img src="photos/superge_logo.png" alt="superge_logo" width="509px" height="200px"></a></span>
                        <span class="stores"><a href="https://www.hervis.si/store/" target="_blank"><img src="photos/Hervis_logo.png" alt="hervis_logo" width="509px" height="200px"></a></span>
                        <span class="stores"><a href="http://sl.sportsdirect.com/" target="_blank"><img src="photos/sports-direct-logo.png" alt="sportsdirect_logo" width="500px" height="200px"></a></span>
                    </div>>
                    <!-- Additional content goes here -->
                </article>
            </section>>
        </div>
    </div>

    <!-- Footer Section -->
    <div class="tm-footer">
        <footer>
            &copy; copyright Adidas 2017
        </footer>
    </div>
</body>
</html>

CSS styles can be found below:

* {
   <!-- CSS styles omitted for brevity -->
}

.tm-footer{
    text-align: center;
    background-color: white;
    padding: 10px;
    font-weight: 700;
    margin-top: 30px;
    clear: both;
}

For visual reference, checkout this screenshot: Showing extra space under the footer

Also, this issue is unique and different from any previous duplicate solutions.

Answer №1

Make sure to make changes to the following code snippet:

Take a look at the live demonstration:

.tm-footer{
    text-align: center;
    background-color: white;
    padding: 10px;
    font-weight: 700;
    margin-top: 30px;
    clear: both;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

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

communicating between domains - js

Background: My latest project involves creating a web application that can download and display housing prices. The data source can be found at The Initial Plan: I aimed to fetch the data directly from the provided link using javascript, and then conver ...

The text alignment is set to center, however, the wrapper, input boxes, and button are not aligning themselves in the center. The logo

Within this webpage, there exists a logo image file with a specified height to ensure proper fit. The logo positions itself beautifully within its designated div, with the wrapper div containing text-align: center, resulting in perfect alignment. Additiona ...

NgMap Angular Pins

While working on implementing Ng-Map for Angular in my application, I encountered an issue. I am retrieving entries from the database and attempting to drop markers on the map. However, even though I have 40 entries, only the first 11 are showing up as m ...

upgrading from Internet Explorer 8 to Internet Explorer 9

Similar Topic: Transitioning from IE8 to IE9 Are there any recommendations for transitioning from IE8 to IE9 in order to operate an application smoothly? What factors should be taken into account for CSS, HTML, and JavaScript prior to the migration? ...

Looking for a seamless way to convert jsp code to html using sightly in AEM 6.1?

I need help transforming JSP code to HTML using Sightly in AEM. In the JSP code, we have a scriptlet that stores a value from the dialog into a JSP variable called "coltype" using the code pageContext.setAttribute("coltype", xssAPI.filterHTML(properties. ...

Having trouble assigning an active class to the selected button in Vuetify's v-btn-toggle component

In my project, I have implemented a toggle feature using Vuetify's v-button-toggle with three buttons. Each button is supposed to have a different active class that changes when clicked. However, currently the respective active class is not being set ...

Tips for arranging links in a vertical layout on a navigation bar that is compatible with every device

I'm having trouble aligning the links vertically in the center of the navigation bar, with the logo overlapping the content. Check out the HTML code below: <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...

Using the "margin: auto" property to center the text box

I am having trouble centering the search box. I tried adding marginLeft: "auto",marginRight: "auto" to the search class but it's not working. Can you please advise me on how to fix this issue? Below is my code snippet and a link to the sandbox: https ...

"JavaScript that doesn't rely on a specific browser

Why does this code behave differently across browsers? What modifications are needed to ensure consistent behavior in all of them? In Firefox, it functions correctly, using the URL /some/path/?searchedText=sometext. However, in IE, nothing happens when cli ...

using javascript to target a specific css selector attribute

I have a CSS file with the following code: .datagrid table tbody td { color: #00496B; border-left: 1px solid #E1EEF4; font-size: 16px ;font-weight: normal; } Is there a way to use JavaScript to dynamically change the font size? The code below worked ...

AngularJS selectChosen does not have built-in support for translation

<select chosen options="myOptions" ng-model="StatCode" data-placeholder="{{'PleaseSelect' | translate}}" ng-options="item[0] as item[1] + ' / ' + item[0] for item in myOptions" required>< ...

Error 403 occurs after submitting the form

Recently, I encountered a 403 error when attempting to submit the form on this page. Interestingly, when I directly accessed the new page by typing the URL into my browser, it loaded without any issues. The PHP code in the initial page looks like this: & ...

Incorporate a class into the fixed navigation menu using fullpage.js

I am attempting to modify the behavior of a sticky menu as the user scrolls down using fullpage.js. My goal is to have the #top-wrapper behave normally when the first section/page loads, and then add a class of is-fixed as you scroll down. When scrolling ...

Adding clickable padding to a Draft.js editor can enhance the user experience and make the editing process

Is there a way to apply padding to the Draft.js Editor so that clicking on the padding area selects the Editor? If I add padding directly to the container div of the Editor, the padding displays properly but clicking on it does not enable writing in the E ...

Achieve a floating right alignment of an unordered list navigation using CSS without changing

I am currently implementing a jquery navigation system which can be found at this link: http://css-tricks.com/5582-jquery-magicline-navigation/ My goal is to have the navigation bar float to the right without changing the order of items (e.g. home, contac ...

Determine if a user has made any spelling errors within an HTML textarea using spellcheck

I am working with a textarea that has the following definition: <textarea spellcheck="true"></textarea> As users type, spelling mistakes are highlighted (such as with a red underline in my browser). Is there a way, possibly using jQuery, to v ...

The Angular controller fails to display any data when inserted within double curly braces on the HTML page

I have been working on a basic binding application using TypeScript. I created a controller called 'bugCtrl' and it appears to be functioning correctly in debug mode (with console.log and alert statements). Below is the HTML code from my page: & ...

Is there a method to dynamically conceal a div element in the source code during runtime?

Is it possible to dynamically hide a div element from the page's source code during runtime using JavaScript, jQuery, or any other method? For example: <div id="abc"> This content should not appear in either the source code or on the visible w ...

Is there a way I can alter the font style of the word 'Logout'?

Hey, does anyone have a solution for changing the text color of "Logout!" to white? echo "Welcome, ".$_SESSION['username']."!<br><a href='logout.php'>Logout!"; <font color="#ffffff">your answer</font> ...

Prevent VueJS form from submitting when the enter key is pressed

Is there a method in Vue.js to prevent form submission when the enter key is pressed inside an input field? I have a basic form with a button and an input field, and I currently handle submission using @submit.prevent="submitFunctionClickFunction". ...