Vast Empty Area Beneath Dual Lines in Bootstrap Design

I'm currently working on the design of my website using Bootstrap, but I've encountered a small issue. I am trying to remove the unwanted space below the images. I have utilized Bootstrap classes and SCSS in my code. Although it may seem trivial, any assistance in identifying what I might be doing wrong would be greatly appreciated.

Unwanted Space Area:

https://i.sstatic.net/A3EjS.png

Bootstrap Code:

<section class="homepage-banner-section">
    <div class="container">
        <div class="row">
            <div class="col-lg-4 col-md-4">
                <div style="height: 67%;">     
                    <img src="img/home-banner-one.png" class="img-fluid mh-100" style="width: 100%; height: 100%;" alt="Responsive image">
                </div>
            </div>
            <div class="col-lg-8 col-md-8">
                <div class="row">
                    <div class="col-12">
                        <div class="therapy-text-wrapper">
                            <h2 class="therapy-text text-center">Start your therapy now!</h2>
                        </div>
                    </div>
                    <div class="col-12">
                        <div style="height: 60%;">  
                            <img src="img/home-banner-two.png" class="img-fluid mh-100" style="width: 100%; height: 100%;" alt="Responsive image">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-12">
                <div class="anxiety-text-wrapper">
                    <h2 class="anxiety-text text-center">Anxiety is very common:<br>
                    worldwide 1 in 14 people <br>
                    have disabling anxiety.</h2>
                </div>
            </div>
        </div>
    </div>
</section>

SCSS :

.homepage-banner-section{
    padding-top: 2%;
    .therapy-text-wrapper{
        .therapy-text{
            background-color: $baby-blue;
            color:$white;
            text-align: center;
            padding: 3% 0;
        }
    }
    .anxiety-text-wrapper{
        text-align: center;
        padding: 2% 0;
        .anxiety-text{
            background-color: $baby-blue;
            color:$white;
            text-align: center;
            padding: 3% 0;
            font-family: Merriweather-Italic;
            font-style: italic;
        }
    }
}

Answer №1

The current image alignment is affecting the overall height of the divs in this section. To address this issue, consider applying a margin-top: -100px; to your anxiety section.

SASS:

.homepage-banner-section {

    padding-top: 2%;

    .therapy-text-wrapper {

        .therapy-text {

            background-color: $baby-blue;
            color:$white;
            text-align: center;
            padding: 3% 0;

        }
    }

    .anxiety-text-wrapper {
        margin-top: -100px;
        text-align: center;
        padding: 2% 0;

        @include media-breakpoint-down(md) { 
            margin-top: -10px; 
            // Adjust or remove the margin for screens smaller than medium
        }

        .anxiety-text {

            background-color: $baby-blue;
            color:$white;
            text-align: center;
            padding: 3% 0;
            font-family: Merriweather-Italic;
            font-style: italic;

        }
    }
}

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

Guide on accessing a local image while setting the background image using JavaScript

I am trying to set a background image from a local source on my computer. Below are two lines of code, one that works and one that does not: (the local one fails) _html.style.backgroundImage = 'url("urlsourceblahblahblah")'; _html.style.backgro ...

Using dots instead of lines for the carousel indicators in PrimeNG

I'm currently working on a carousel feature, but I want to change the indicators from lines to small dots. I know the solution lies within the CSS files, but I'm not sure how to implement it. I think I need to create a new CSS class, but I could ...

Adjusting the Scroll on the Slider Container

I'm currently developing a dynamic news feed feature that incorporates slides to display a brief summary along with a "Read More" button. Clicking on the "Read More" button will expand the content, pausing the scrolling mechanism until minimized by cl ...

Steps to automatically set a selected item when the page is loaded for the first time

I am currently working on a test project using Angular where I have to choose a branch, and once selected, graphics will load with the specific information related to that branch. However, when the page initially loads, I encounter an issue where the selec ...

Ways to Remove Focus from a Button in Blazor/C# by Triggering the Escape Key without JavaScript

I am in the process of developing a tooltip feature within the Blazor framework. The main goal I have is to make the tooltip disappear when the escape key is pressed while focusing on the button. Currently, I have successfully implemented this feature usi ...

Auto-fill feature malfunctioning

Currently, I have implemented jQuery Autocomplete to retrieve data from a database and display it in the search box. Everything is working perfectly fine, except for one issue - when hovering over the results in the dropdown, instead of displaying the resu ...

The drop-down menu vanishes mysteriously before it can be selected

I'm having trouble making my pop-up menu touchable. It keeps disappearing. I've tried a few things but nothing seems to work: - Placing the display:none above the hover didn't make a difference. - Changing the position: absolute in #navbar ...

Tips for creating a synchronous jQuery "$.post" request

After much research and effort, I have finally come to the last item on my bug fix list. This one involves creating a function that will return true or false to indicate whether the validation was successful. My approach involves using ajax to compare cer ...

What is the best way to adjust the width of a table td element using CSS in Spiceworks?

I'm attempting to modify a CSS code snippet for Spiceworks. Here is the specific line that I need to adjust: <td class="body-id cell-id" style="width: 12%; "></td> The following code: SPICEWORKS.utils.addStyle('body{background-col ...

Exploring the world of HTML display and the various data types in

My website titles don't break nicely when the lines are longer than the screen width, while the articles always display beautifully regardless of screen size. After conducting several tests, I discovered that the issue was due to the different data ty ...

Text being enveloped in a span tag

Currently, I have a table displaying a list of users with their corresponding roles. However, the roles column is sometimes wrapping before reaching the end of the line. The user list data looks like this: $scope.userList = [{ "id": 1, "name":"AB ...

Experiencing problems with CSS compatibility while transitioning from vanilla JavaScript to React

Currently, I am working on revamping the frontend of an app that was initially built with vanilla javascript and transitioning it to a React framework. However, I'm encountering some challenges with styling the HTML elements. Specifically, the textare ...

Using Jquery to activate a mouseover event following a specific duration

Currently facing an issue with my code: I have an h2 element nested within a div with the id <div id="hidediv1">. Here's the code snippet: $("#hidediv1").mouseover(function(){ $('#hide1').show(500); }); $("#hidediv1").mouseleave(fun ...

Tips for accurately aligning a relative p tag within a td

Description: I am trying to prevent text overflow in a table cell and position the text underneath a header without wrapping it under an image. I have tried setting a static width for the image and adjusting the left property, but it is not working as expe ...

Utilizing Jquery for Enhanced HTML5 Validation

I need to ensure compatibility with browsers that do not support HTML5 validation. My goal is to display the basic error message from the browser using HTML5, while also adding a CSS class of "error" to each input, label, and parent div for fields with err ...

Searching and manipulating arrays in PHP

<?php include 'database.php'; $sql="SELECT `j_company`,`j_salary`,`j_title` FROM `jobs`"; $query=mysqli_query($conn, $sql); if(!$query) { echo "<h1>Unsuccessful</h1>"; echo("Error description: " . ...

Ensure that the checkbox is always selected

My goal is to have a checkbox always checked unless we intentionally want it to be unchecked. Check out the following HTML code: <input type="checkbox" class="custom-control-input" [(ngModel)]="productDetails.iscanRetrunable" name="isc ...

I'm currently working on a course assignment and I've encountered an issue where nothing happens when I try to execute node

Having trouble with the readline for input execution. Any helpful hints or tips? I've been using it in the same file for all exercises, checked stackoverflow too but realized I'm on Windows. This is my code const { rejects } = require('asse ...

Steps for utilizing an Angular property as the value for an HTML form input

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name= ...

CSS and jQuery UI URLs are not resolving properly in MVC framework after deployment

Basically, the issue is that the url for an image in jquery-ui.css file does not resolve once the site is deployed. The website is deployed under the default web site in IIS7, causing the browser console to look for the image in a different location than e ...