"The space between the header-main section and the main-footer section is pure white

I'm facing an issue with the white space between the header-main and main-footer sections. I would like to either match their color to the rest of the website or completely remove the space. The color I want to use is #fefcf5. I hope this edited version addresses the problem. Thank you.

@import '_common/normalize';
        html {
          font-size: $global-font-size;
          box-sizing: border-box;
        }

        body {
          padding: 10px;
          margin: 0;
          font-family: "Noto Serif", Serif;
          font-weight: 400;
          -webkit-font-smoothing: antialiased;
          -moz-osx-font-smoothing: grayscale;
          line-height: 1.7;
          color: #0a0a0a;
          background-color: #fefcf5 !important;
          scroll-behavior: smooth;
          border-top: 3px solid $theme-color;
          min-height: 100vh
        }

        @include max-screen() {
          body {
            border-top: 0;
          }
        }

        ::selection {
          background: #fefcf5;
          color: #fefcf5;
        }

        
        img {
          max-width: 100%;
          height: auto;
          display: inline-block;
          vertical-align: middle;
        }

        a {
          color: $global-font-color;
          text-decoration: none;
        }

        @each $header,
        $size in $global-headings {
          #{$header} {
            font-size: $size;
            font-family: $global-serif-font-family;
          }
        }

        .container {
          margin: 0 auto;
          width: $global-body-width;
          background-color: #fefcf5;
        }

        .header {
          background-color: #fefcf5;
          margin: 0;
        }

        .footer {
          background-color: #fefcf5;
          margin: 0;
        }

        .content-wrapper {
          padding: $global-container-padding;
          background-color: #fefcf5;
          min-height: 100vh;
        }

        @include max-screen() {
          .container {
            width: 100%;
            box-shadow: -1px -5px 5px $gray;
          }
        }

        
<html lang="en">
<head>
<script src="/livereload.js?mindelay=10&amp;v=2&amp;port=4321&amp;path=livereload" data-no-instant="" defer="">
</script>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Archive - </title>
  <meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">

<meta name="theme-color" content="#f8f5ec">
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">

... (omitted for brevity) ...

Answer №1

To eliminate the space above "2021," apply the CSS rule margin-top: 0 to the element

.archive .collection-title:first-child .archive-year

The space above "2021" represents the top margin of the first h2 with the class .archive-year (15px), causing it to exceed its container due to "collapsing margins."

If you prefer to maintain the spacing, consider adding padding-top: 15px in conjunction with the previous selector.

Answer №2

Experiment with this method in your programming, change the attribute margin to padding inside the .archive class.

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 could be causing the horizontal scroll bar to appear on the Web Page, even though it should fit perfectly on

I've designed this website to perfectly fit within the browser window, but for some reason, there's a horizontal scrollbar appearing. When a site fits properly, there shouldn't be a need for a horizontal scroll bar. I double-checked my zoom ...

Switch classes while navigating within a div

My website has a sticky sidebar with a list of cars and their corresponding categories in a table: <ul class = "cars"> <li class=""><a href="javascript:void(0)" class="model" data-id="1"> BMW </a></li> ...... ...

What is the best way to choose a random number using jQuery?

<div class="yyy"></div> <p>...</p> <pre><code>let content = $(".xxx").text(); $(".yyy").html(content); http://jsfiddle.net/tQeCv/ I just require this specific input : Number is {1|2|3|4}, and {one|two|three|four} ...

Upon page load, a dazzling SVG file will flicker before being adorned with CSS styles

I'm experiencing an issue with an SVG arrow icon on my webpage that flashes quickly across the entire screen upon page load before settling into its proper size and placement. I've tried using CSS to initially hide the icon and then reveal it aft ...

Unable to access $_POST parameters in PHP when making an Ajax request

My HTML file is shown below: <script> var xml = new XMLHttpRequest(); xml.onreadystatechange = function(){ if (xml.readyState === 4 && xml.status === 200) { console.log(xml.responseText); } } xml ...

Capture Video on iOS devices using the MediaRecorder API and display it using HTML5 Video Player

Issue: I am facing an issue where I cannot record video or get a video stream from the camera on iOS through my Angular web application built using ng build. Investigation: In my investigation, I explored various websites that discuss Apple iOS features ...

The label is not displaying the specified font-family in CSS

Below is a snippet of code that I am having trouble with: testing some content Additionally, here is the CSS code for it: label { font-family: "Andale Mono"; } The issue I am facing is that no matter which font style I try to apply, it does not seem to ...

jQuery.get() function is limited to specific types of webpages

I have successfully combined multiple weather APIs on my website, which can be found here. Recently, I started using the weather.gov API and it has been quite effective. However, there are certain data points that I need to extract which the weather.gov A ...

The Bootstrap 4 modal is failing to appear on the screen

My design features an image within a centered div, overlaid with a semi-opaque textbox containing an h1 element. I'm trying to implement a Bootstrap 4 modal component that pops up when the h1 is clicked. Despite following various tutorials for creatin ...

Display HTML using JavaScript/jQuery

I am trying to figure out how to print a document by passing custom HTML code. Below is the code I have tried, but unfortunately it's not working: function Clickheretoprint() { var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes, ...

Tips for adjusting the size of a container to fit its child element in a flexbox layout, where the flex-direction is set to column

Below is the functional code: .container{ display: flex; background-color: lightgreen; justify-content: center; alighn-item: center; } .child{ margin-left: 10px; height: 200px; background-color: yellow; display: flex; flex-direction: ...

What impact do media queries have on scaling web pages?

Why does the page scale change with media queries? @media only screen and (min-width: 500px) { body { background-color: blue; } } @media only screen and (min-width: 800px) { body { background-color: green; } } @media only screen and (min-width: 1000px) ...

How can I dynamically generate multiple Reactive Forms from an array of names using ngFor in Angular?

I am in the process of developing an ID lookup form using Angular. My goal is to generate multiple formGroups within the same HTML file based on an array of values I have, all while keeping my code DRY (Don't Repeat Yourself). Each formGroup will be l ...

Guide on eliminating flex in CSS

Having an issue with aligning two grids created in HTML using Bootstrap. Below is the code: <!DOCTYPE html> <html lang="en"> <head> <title>IRIS Flower Classification</title> <link rel="stylesheet" href="{{ url_for( ...

Having trouble getting the .each() method to function properly in jQuery

Looking for a solution to a similar issue here. Currently, I am attempting to iterate through multiple forms on a webpage and perform various actions with those forms. However, I am facing some challenges in making it work. Below is the code I am using: ...

Enhancing Transparency of WMS Layers in OpenLayers

I need help figuring out how to add transparency to a WMS layer in openlayers. Here is the current javascript code for a non-transparent layer: var lyr_GDPSETAAirtemperatureC = new ol.layer.Tile({ source: new ol.source.TileWMS(({ ...

"Place the content at the center of the row using display block in Bootstrap version

Having modified the bootstrap.min.css file in my Bootstrap v4.3.1, I replaced all instances of display:flex; with display:block;. However, after making this change, I noticed that the rows were no longer centered, even when using justify-content-center. T ...

Step-by-step guide on permanently updating the text of select options with JavaScript

Here is the code for a select option with different values: <select id="test" onchange="changeContent()"> <option>1</option> <option>2</option> <option>3</option> </select> The javascript function that chan ...

Tips on resizing images within a container to maintain aspect ratio

I am trying to create a layout with a flex container containing 2 divs - one with an image that floats left, and the other with some paragraphs floating right. How can I make sure that the image scales alongside the paragraphs while maintaining its aspect ...

Is there a quicker alternative to the 500ms delay caused by utilizing Display:none?

My div is packed with content, including a chart from amCharts and multiple sliders from noUiSlider. It also features various AngularJS functionalities. To hide the page quickly, I use $('#container').addClass('hidden'), where the rule ...