The footer in the CSS has an excessively large margin-top that needs to be adjusted

In my case, I am using a template where the same page is repeated with the same template. However, there seems to be a massive margin-top element on three of my pages, and unfortunately, I can't seem to get rid of it.

I attempted adding a style="margin-top:30px" and even tried adding style="margin-top:30px; !important" in an attempt to override this issue, but neither worked.

Through the developer tool inspector in Chrome, I observed that the margin-top is set at 698px, which is way more than what I desire... ideally, it should be around 30px or less.

<footer id="footer" class="dark" style="margin-top: 698px;">

The HTML code for the footer is as follows:

<footer id="footer" class="dark">
<div class="container">

<div id="copyrights">
<div class="container clearfix">
<div class="col_half">
Copyrights &copy; 2013-2019<br>Daniël E. Cronk<br>

</div>
<div class="col_half col_last tright">
<div class="fright clearfix">
<a href="#" class="social-icon si-small si-borderless si-facebook">
<i class="icon-facebook"></i>
<i class="icon-facebook"></i>
</a>
<a href="https://www.twitter.com/dereizigercronk" class="social-icon si-small si-borderless si-twitter">
<i class="icon-twitter"></i>
<i class="icon-twitter"></i>
</a>
<a href="https://www.instagram.com/a333msptoams" target="_blank" class="social-icon si-small si-borderless si-instagram">
<i class="icon-instagram"></i>
<i class="icon-instagram"></i>
</a>
</div>
<div class="clear"></div>

</div>
</div>
</div>
</div>
</footer>

Upon inspecting the CSS hierarchy, it appears that the footer has the following CSS elements:

bootstrap.css

article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
    display: block;
}

style.css

#footer {
position: relative;
background-color: #EEE;
border-top: 5px solid rgba(0,0,0,0.2);
bottom: 0;
}

/* Other styles from style.css */


.dark.css</p>

<pre><code>#footer.dark,
.dark #footer {
    background-color: #333;
    color: #CCC;
    border-top-color: rgba(0,0,0,0.2);
    margin-top: 30px;
    display: inline-block;
    position: fixed;
bottom: 0;
}

Answer №1

It's not exactly the same situation as adding margin in CSS to make the footer stay fixed at the bottom, which can result in some space above the footer (equal to the screen height).

#footer.dark,
.dark #footer {
    background-color: #333;
    color: #CCC;
    border-top-color: rgba(0,0,0,0.2);
    margin-top: 30px;
    display: inline-block;
    position: fixed;
    bottom: 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

What is the procedure for inserting comments into inline CSS?

You know, I've been wondering how to effectively comment out inline CSS styles within HTML tags. Is it best to use the /* */ comments from CSS? Or should we opt for <!-- --> in HTML? <span class="color_dark" style="top:20px;font-size: 17px;l ...

Submenu animation that "bursts onto the scene"

I'm facing an issue with my menu that has sub-items inside it. To achieve the animation effect I desire, I need to extract the width, height, and first-child's height of the sub-menu. While my animation is working most times, there are instances ...

Unable to adjust the padding of a div while the Bootstrap 4 navbar is in a collapsed state on mobile devices

I am facing an issue with a fixed navbar at the top of my page. Below the navbar, I have the page content which includes a Bootstrap 4 image carousel. The problem arises on mobile devices where I need to add top-padding to the page-container (below the nav ...

What causes the table to expand with new cells once the database information is shown?

I'm confused as to why an empty cell is being added to the right even if there is data from the database to display. This particular code is meant to showcase a school schedule. Attached is a picture showing how it currently appears. Below is the PH ...

What is preventing the addition of links to the navigation bar when using a sticky navigation bar?

Currently, I am in the process of developing a blog website using Django. One of the features I have successfully implemented is a sticky navigation bar. However, I am facing a challenge with adding links to the menu on the navigation bar due to existing ...

Struggling to line up text boxes with CSS borders within div elements in a neat row

Here is the HTML snippet with a div containing four sub divs with a class named 'city' that I'm trying to align in one row using Bootstrap. I have included my stylesheet below the HTML, and despite spending over an hour adjusting margins, I ...

Form using Ajax technology, including two drop-down menus sourced externally

Is there a way to automatically populate a second drop-down list with all models once a selection is made in the first drop-down on a form? Below is the code snippet: <form> <div class="landing_quote_left"> ...

Experience the advanced NgPrime p-dropdown template with templating, filtering, and a clear icon that collapses when wrapped within a form element

Check out this link for a demo Whenever I enclose the code below in a </form> element, the drop-down menu collapses. <h5>Advanced with Templating, Filtering and Clear Icon</h5> <p-dropdown [options]="countries" [(ngModel)]=& ...

How can you turn off the default browser's tooltip in Angular?

I'm currently using the "720kb.tooltips" plugin in Angular to display tooltips. Here is the HTML snippet I am using: <img src="icon_info.png" width="20px" tooltips title="tooltip" tooltip-side="bottom"/> Upon hovering over the image, a black ...

Is it possible to manipulate an image tag's image using only CSS?

Is it possible to hide an image from the src attribute of an <img> tag and instead set a background image on the tag using CSS? One idea could be adjusting the positioning or text-indent of the actual image to move it out of view, and then applying ...

Is it possible to integrate angular-bootstrap-datetimepicker with bootstrap3?

Looking for an accessible date picker solution for my project. The project is built on Bootstrap3, but the angular-bootstrap-datetimepicker has a dependency on Bootstrap4. Can I still integrate angular-bootstrap-datetimepicker with Bootstrap3? ...

There are various IDs in the output and I only require one specific ID

I have a JSON fetcher that is functioning properly. However, whenever I request an ID, it returns all the IDs present in the JSON data. Is there a way to retrieve only the latest ID? This is my first time working with JSON so I am still learning. $(docu ...

Why isn't the alignment and background color of my navigation menu (nav) functioning properly?

Having trouble with my navigation styling - the alignment and background color only show up when I remove the closing brace for the "nav" CSS. I have 2 different CSS stylings in place to center the nav items and add a background color, but something's ...

Tips for centering a list using flexbox technique

I have 3 boxes stacked vertically using flexbox, currently positioned to the left. I am looking for a more elegant solution to center them horizontally without compromising the layout. I attempted using margin: 10px auto on a div which seemed awkward in th ...

Utilizing Material-UI for CSS styling in a live environment

My application has a 'dashboard' feature that utilizes material-ui. Within this dashboard, other apps are called and rendered. While this setup functioned smoothly during development, I encountered issues once switching to a production build. The ...

Excessive-y does not have scrolling capabilities

I'm having an issue with the overflow-y: scroll property under the "Online Contacts" section in my code. It's not working as expected, but when I change the position to absolute and make certain adjustments, it starts working. I'm using Boot ...

Pressing a key once causing two actions when managing content in a separate window

Issue: I am facing a problem where I receive double keypresses from one key event when the event updates content in two separate windows. (Please keep in mind that I am not an expert in this field and appreciate your understanding.) I am attempting to use ...

ReactJS Application: Issue with Selective Mobile Scrolling

I've been working on a ReactJS web app where we mainly use styled-components for styling, but also sometimes utilize index.css for global styles (such as body and html). The application consists of an app header, a page header, and a container with a ...

What is the best way to update the color CSS property of an element with jQuery?

Can someone explain to me how to modify CSS using jQuery? I am trying to change the font color of "Valid VIN" to red, but my current code doesn't seem to be working: $("#result").html(<font color="red">"Valid VIN"</font>); ...

Utilize CSS for Sticky Headers to Create Full Page Scrollbars for Table Control

Here is a code sandbox showcasing the use of Material UI's Table within a Paper component with a sticky header: https://codesandbox.io/s/2n40y I am looking to have the scrollbars appear at the edges of the browser page, bottom and right, while still ...