What is the best way to eliminate the space between the image and the text located beneath it?

I am facing an issue with some whitespace between the image and the content below it. I attempted to use body{background-color:black;}, however, this overrides my color gradient in the lower part of the page. I have not experimented with using something like nowrap as I am unsure of how to implement it correctly.

Below you will find my HTML code:

<!DOCTYPE html>
{% extends "base.html" %}

{% block body %}
{% load static %}
<head>
    <link rel="stylesheet" type="text/css" href="{% static 'TSAWeb_App/contact.css' %}">
</head>

<body>
<div class = "ContactUs">
    <img src = "https://i.pinimg.com/originals/38/e9/9f/38e99f0083d07f6ac1df75b6bbb0fbf2.jpg" width = "100%">
    <div class = "w3-display-bottommiddle w3-container w3-text-white w3-padding-32 w3-hide-small"
            style = "white-space:nowrap">
        <h1 style = "text-align:center"><b>Our Socials</b></h1>
    </div>
</div>

<div class = "MainBody">
    <p style = "text-align: center">
        <b>Find us at...</b>
    </p>

    <br>

    <div class = "Contacts">

        <figure class = "Insta">
            <a href = "https://www.instagram.com/dulles.tsa/">
                <img src = "https://www.freepnglogos.com/uploads/instagram-logos-png-images-free-download-2.png"
                        width = "50%" height = "50%">
                <figcaption>Instagram</figcaption>
            </a>
        </figure>

        <figure class = "Gmail">
            <a href = "mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ee8a9b82882b9dc099c68898839bc88989ad86aaaeac">[email protected]</a>">
                <img src = "https://upload.wikimedia.org/wikipedia/commons/4/45/New_Logo_Gmail.svg"
                        width = "50%" height = "50%">
                <figcaption>Gmail</figcaption>
            </a>
        </figure>

        <figure class = "Discord">
            <a href = "https://discord.gg/uYFVqsy">
                <img src = "https://www.rust-evolution.net/wp-content/uploads/2018/12/discord-icon-template-9.png"
                        width = "50%" height = "50%">
                <figcaption>Discord</figcaption>
            </a>
        </figure>

        <figure class = "Twitter">
            <a href = "localhost:8000/contact">
                <img src = "http://assets.stickpng.com/images/580b57fcd9996e24bc43c53e.png"
                        width = "50%" height = "50%">
                <figcaption>Twitter</figcaption>
            </a>
        </figure>

        <figure class = "Remind">
            <a href = "localhost:8000/contact">
                <img src = "https://www.pngkit.com/png/full/97-972295_remind-logo-blue.png"
                        width = "50%" height = "50%">
                <figcaption>Remind</figcaption>
            </a>
        </figure>

    </div>
</div>

</body>

{% endblock %}

Additionally, here is my current CSS:

h1{
padding-bottom:125px;

}

p{
font-size:20px;
}

.Contacts {
  display: flex;
  align-items: center;
}

.Contacts figure {
  flex: 1;
  text-align: center;
}

.MainBody{
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.5));
color:white;
}

a{
color:white;
}


Answer №1

When it comes to the title Our Socials, the reason for resetting the margins is due to browser default settings. It is a common recommendation to reset all margins to 0 in order to ensure consistency across platforms.

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

Is there a way to tally up the number of green items and display a <p> tag when every item has been marked green?

I have created a checklist that includes checkboxes. I am looking to display some text when all the checkboxes are checked and green. Can someone assist me with writing the code for this functionality? $(document).ready(function() { $("i").click(funct ...

What could be the reason that I am unable to absolutely position generated content in Firefox?

I am currently designing a horizontal navigation bar and here is the CSS I have used: #topnav { clear: both; overflow: hidden; display: table; } #topnav ul { display: table-row; } #topnav ul li { display: table-cell; vertical-ali ...

"Arranging elements in a stack using Bootstrap's collapse

Currently, I am utilizing the collapse feature of Bootstrap 4.0.0 to show and hide a bootstrap "row". Within this row are four columns - "col-md-3" - containing buttons. The layout of this row is exactly as I desire until I include the "collapse" class, at ...

Adding a class name to the three active, visible, and shown slides in SwiperJS is a simple process that can be done by

Currently, I am working on customizing a carousel in Swiper with slidesPerView={3}. My goal is to style the sliders that are not visible on the screen. I have made multiple attempts to achieve this: First, I tried adding the attribute slideActiveClass="sw ...

Can a callout or indicator be created when a table breaks across columns or pages?

As we develop HTML pages for printing purposes, one specific requirement for tables is to include an indicator like "Continues..." below the table whenever a page or column break occurs. Additionally, in the header of the continuation of the table, we need ...

Are "Color Scheme" and "Color Palette" distinct from each other?

What is the difference between a color scheme and a color palette? In one of my projects, which is a web template, there are options for customers to customize. However, I find myself confused with the naming conventions for two color-related options. Op ...

Transform one Scss file into CSS by utilizing the compass-watch feature

Converting Scss modules to CSS one by one manually is becoming exhausting for me. I'm looking for a way to convert my individual Scss file from multiple modules at once. Currently, I am using compass watch on the command line to compile CSS with ruby ...

Increase resolution of game canvas to support high definition (retina) display

In order to enhance the resolution of my game canvas and make it retina-quality, I am using Gamemaker software. However, I am unsure of how to actually implement this upgrade. If you are facing a similar issue, these two resources provide clear explanatio ...

"What is the best way to eliminate duplicate data from an ng-repeat loop in AngularJS

I have a query regarding appending data from the second table into $scope.notiData in AngularJS. Additionally, I need to figure out how to remove ng-repeat data when the user clicks on the remove symbol X. I have attempted some code but it is not functioni ...

My HTML Won't Recognize the CSS File

Despite trying various paths and browsers, I am unable to link my CSS file to my HTML file. When inspecting the page elements and checking under resources, the CSS file does not appear. Here is a snippet of my HTML: <html> <head> <meta ...

Attempting to ensure that my website is fully optimized for all devices and

I am currently facing an issue with my CSS code on iPad. I want to change the background-image displayed based on whether the user is using an iPad or not. Specifically, I want to use headerold.jpg as the background-image for iPads while keeping headernew. ...

Issue: The system does not recognize 'cleancss' as an internal or external command

After successfully installing clean-css via npm command line, I was eager to start using it to concatenate and minify some css files. However, my excitement quickly turned to frustration when I encountered this error: 'cleancss' is not recognize ...

What is the reason for the presence of additional space below when using x-overflow:hidden?

When I place two spans inside each other and use overflow-x:hidden on the inner span, it results in extra space below the inner span. Why does this happen? <span style="" class="yavbc-color-tip"><span style="">Some text</span></span&g ...

Implementing function invocation upon scroll bar click

I have a Div element with a scroll bar. When a user clicks the scroll bar, I want to call a function based on that click event. How can I achieve this? On the client side, I am using jQuery and on the server side, I am using PHP. I am familiar with makin ...

sort through HTML table data following a selection from the dropdown menu

After selecting a dropdown entry from my SQL table, I can filter the results in my table accordingly. By default, the table displays results with status "finished" and "open". However, I am looking to have a static entry in the dropdown that shows me all r ...

Layering Text onto Images with Bootstrap

Recently, while delving into the world of bootstrap, I encountered a puzzling issue - my text kept overlapping the image. After some trial and error, it became clear that the problem stemmed from either my misuse of the "col" within the row, or the intrica ...

What could be the reason for the Bootstrap 3 row not expanding to accommodate the content?

I am working with the following HTML structure: <div class="container-fluid"> <div class="row"> <div class="col-sm-push-3 col-sm-6 text-center wrapper"> <div class="col-sm-4 inner-wrapper"> & ...

The form submits immediately after jquery is activated

One challenge I'm facing involves multiple forms on a single page being submitted using jQuery. Currently, I have the following code snippet: $("form").submit(function (e) { // Submit form via Ajax }); The problem arises when the form is only s ...

Leveraging a pair of getElementById calls

Is it feasible to chain getElementById method calls like this? this.getElementById('first-id').getElementById('second-id') Unfortunately, attempting this results in an error stating "getElementById(...).getElementById is not a function ...

Having difficulty automatically populating a textarea with the chosen option from a datalist

Is there a way to automatically populate the Address field of a client in a textarea based on the input of the client's name in an input field? I have created a 'for loop' to retrieve a datalist of client names. For the address, I retrieved ...