Utilize bootstrap to smoothly remove the element from the layout without causing any unnecessary horizontal scrolling

Recently, I have been exploring the Bootstrap framework as a newcomer to this technology. While working on my landing page, I encountered an issue when trying to position an image next to some text using the grid system of Bootstrap. Initially, everything seemed to be working fine until I attempted to use position: absolute and left:somePX to adjust the image placement. This caused a horizontal scroll and pushed the image out of the body of the page. How can I prevent this scrolling behavior and simply cut the image to position it as desired?

Note: Despite having applied various templates with only CSS before, I have never faced a similar problem.

Thank you for your assistance!

Below is my HTML code snippet:

/* landing */
        
        /*this is the image style*/
        
        .landing {
          padding-bottom: 100px;
          margin-right: 0;
        }
        
        .landing .right .image {
          position: relative;
        }
        
        .landing .right .image .back img {
          position: absolute;
          left: 100px;
        }
        
        .landing .right .image .mockups {
          position: absolute;
          top: -100px;
          left: 100px;
        }
        
        
        /*this is text style I don't think the problem is here but I put it*/
        
        .landing .left {
          padding-top: 80px;
          padding-left: 80px;
        }
        
        .landing .left h1 {
          line-height: 1.3;
          margin-bottom: 20px;
        }
        
        .landing .left p {
          font-size: 15px;
          margin-bottom: 20px;
        }
        
        .landing .left button {}
<div class="landing row">
          <div class="col-md-6 left">
            <div class="container">
              <h1>Next generation digital banking</h1>
              <p>Take your financial life online. Your Easybank account<br> will be a one-stop-shop for spending, saving,<br> budgeting, investing, and much more.</p>
              <button class="btn linear" type="button">Request Invite</button>
            </div>
          </div>
        
          <div class="col-md-6 right">
            <div class="image">
              <div class="back">
                <img class="back-image img-fluid" src="images\bg-intro-desktop.svg" alt="">
              </div>
              <div class="front">
                <img class="img-fluid mockups" src="images\image-mockups.png" alt="">
              </div>
            </div>
          </div>
        </div>

Answer №1

To control the horizontal overflow in your body, just include:

<style>
     body{
          overflow-x: hidden;
        }
</style>

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

The element's height appears to be fluctuating unexpectedly when I attempt to adjust it using percentage values within a narrow range

I'm utilizing React and Bootstrap in this project. Here's an overview of my code: I have an element with height set to 0, in rem. My goal is to make the height of this element increase as I scroll down the page, creating the illusion that it is ...

Input the latest data into the Bootstrap form

Implementing the bootstrap4 framework in my web application, I have a table displaying various values. Each row includes an edit button at the end of the row (last column). The requirement is that when this edit button is clicked, a form should pop up with ...

How can I implement a scroll bar in Angular?

I am facing an issue with my dialog box where the expansion panel on the left side of the column is causing Item 3 to go missing or appear underneath the left column when I expand the last header. I am looking for a solution to add a scroll bar so that it ...

What are some tips for customizing the NavBar Bootstrap 4 Layout to fit a unique design?

Good evening everyone, I am currently working on a website project for a client who has provided me with specific requirements for the Navbar design. While it seemed straightforward at first, I have spent several hours trying to perfect the layout. I am ...

CSS Drop-Down Menu Fails to Function Properly in Firefox and Internet Explorer

Can you help me with this issue I'm having with my website design? In Google Chrome, Opera, and Safari, everything looks great. But in Firefox and the latest version of IE, it's a different story. Here is the HTML code: <div id="navbar"> ...

Is there a way to verify the content inside the :before selector using Jasmine within an Angular 6 application?

Looking to test whether the content of a label changes based on the checkbox being checked using Jasmine in an Angular 6 project. Is this feasible? Code snippet: HTML <input id="myCheck" class="checkbox" type="checkbox" /> <label for="myCheck" ...

Issue with background in list items

I am struggling with aligning the background of my vertical menu to the right and center from the top. Here is the code I have tried: ul.nav { margin:0; background-position:center; background-image: url(../images/nav_bg.gif);font-family: "Century Go ...

Adjusting the width of a div element using a button

I am currently diving into the world of JavaScript, React, and Node.js. My current challenge involves attempting to adjust the width of a div element using a button. However, I keep encountering the same frustrating error message stating "Cannot read prope ...

Issues with Bootstrap indicators and slide controls functionality are being experienced

I am currently exploring a method to create a carousel with thumbnails by referring to this example. I have followed their instructions closely, but unfortunately, clicking on the thumbnails and indicators does not seem to be working as expected. The onl ...

What is the process for updating the source in an input box?

How can I use JavaScript to update the src value of an iframe based on input? <input class="url" id="url1" type="url" value="youtube url"> <input onclick="changevideo()" class="add-video" id="add-video1" type="submit" value="add to play ...

Steps for properly inserting a hyperlink:

I'm in need of assistance. I have a grid containing several images that I want to make clickable by adding anchor tags, but when I do this, the images seem to disappear completely. I suspect there's an issue with them being inside the container d ...

Spinning triangle around central point using CSS

I'm working on a project that includes the following code snippet: body { background-color: #312a50; font-family: Helvetica Neue; color: white; } html, body { height: 100%; } .main { height: 100%; width: 100%; display: table; } .wr ...

Blazor: Personalizing color variables in _root.scss - A Step-by-Step Guide

Upon inspecting the generated project, I noticed a multitude of color variables such as --bs-body-bg. The developer tools indicate it is in _root.scss, however, that file appears to be non-existent and I suspect those variables may actually reside within b ...

Display the division content from a user control without the need to open a separate window

Seeking assistance with a USER CONTROL containing a <div> element and a button. The goal is to successfully print the <div> content upon button click, regardless of the control's location. It's important that the printing process does ...

Tips for exchanging divs in a mobile view using CSS

Illustrated below are three separate images depicting the status of my divs in desktop view, mobile view, and what I am aiming for in mobile view. 1. Current Status of Divs in Desktop View: HTML <div id="wrapper"> <div id="left-nav">rece ...

Ways to center an image within a div using Bootstrap 4

I am currently using Bootstrap version v4.0.0-beta.3 and facing a challenge with aligning an image in the absolute center of a fixed-height div tag. While I have successfully aligned the image horizontally using the mx-auto and d-block classes, I am strugg ...

encase the text within a div to create a visual flow

Is there a way to make div 2 encircle div 1? Both divs have text inside. +---++------------------+ | || | | 1 || | | || 2 | +---+| | +---- | | | ...

"Duration parameter in jQuery animate() function not working as expected in Firefox

Just starting out with jQuery and I have a class for absolute centering (it's working as intended): .Absolute-Center { margin: auto; position: absolute; top: 0; left: 0; bottom: 0; right: 0; } #logo { background: url(logo.png) no-rep ...

Adjust the background color of the dropdown menu

I'm struggling to change the background color of the property address picker dropdown from transparent to white. I've been trying different things but can't seem to get it right. Any suggestions? Additionally, I want to change the cursor to ...

Background image on webpage failed to load

I've encountered an issue with a background image I downloaded for my website - it simply will not display. Here is the CSS code I am using: background-image: url(Resources/Icons/background-image.jpg); background-attachment: fixed; Even after tryin ...