How can I prevent an image from appearing to float on the page while using the img-fluid class?

While testing the responsiveness of our website built with Bootstrap, we noticed an issue where an image appears to be "floating" on top of the page when viewed in iPad mode using the browser's device toolbar. Despite this, the site functions correctly on desktops, mobile devices (Galaxy, iPhone X, etc.), and even iPad Pro settings.

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

.our-story {
  color: #fff;
  background-color: #67b7f2;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f7959898838483859687b7c2d9c7d9c5">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/>

<div class="container-fluid pt-5">
  <div class="row our-story">
    <div class="col-md-6 offset-md-1 mb-3">
      <h2 class="mt-5">We Move Lives</h2>
      <p>Our process begins with asking a lot of questions and listening to your needs and concerns. Then we survey your entire home and assess everything that needs to be moved. We identify high-value, fragile items such as pianos, antiques, paintings, and chandeliers that will require special care. Finally, we create a detailed schedule for packing, loading, and delivery.</p>
      <a href="about-us.html"><button type="button" class="btn btn-outline-tosa">Our Story</button></a>
    </div>
    <div class="col-md-4">
      <img src="img/steve-justin-bruce-standup.png" class="img-fluid mt-5">
    </div>
  </div>
</div>

https://i.sstatic.net/3Dq7g.png

Answer №1

Got it, I recommend making some adjustments to the margin -> padding and adding flex-end to the image container cell. By giving the image a bottom anchor, it will behave as expected.

Also, avoid placing a button inside an anchor, not a good practice. Cheers!

.our-story {
  color: #fff;
  background-color: #67b7f2;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="01636e6e75727573607141342f31333e">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/>

<div class="container-fluid">
  <div class="row our-story">
    <div class="col-md-6 offset-md-2 pb-3 pt-5">
      <h2>We Move Lives</h2>
      <p>Our process begins with asking a lot of questions and listening to your needs and concerns. Then we survey your entire home and assess everything that needs to be moved. We identify high-value, fragile items such as pianos, antiques, paintings, and chandeliers that will require special care. Finally, we create a detailed schedule for packing, loading, and delivery.</p>
      <a class="btn btn-outline-tosa" href="about-us.html">Our Story</a>
    </div>
    <div class="col-md-4 d-flex flex-end justify-content-center pt-5">
      <img src="https://picsum.photos/seed/picsum/200/300" class="img-fluid">
    </div>
  </div>
</div>

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

Unlocking broken Input Options in Select Events with jQuery

How can I enable the first input when option one is selected using jQuery? Below is a code snippet for reference: <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> <div class="form-material" ...

Event fails to trigger when attached to different elements

Currently, I have an onchange event linked to the input text box and an onclick event attached to a text link. Interestingly, when I click on the link after editing the textbox, the click event does not trigger - instead, the change event is fired. If you ...

What's the best way to set a specific default value for a numeric slider that isn't arbitrary?

My numeric slider code allows me to set minimum and maximum values, but I'm struggling to specify a specific default value when the page loads. Although I can provide a random value, I want the default value to be fixed like using the attribute value= ...

"Exploring the possibilities of customizing Material UI tabs and implementing a tabs scroller

I'm currently trying to customize the appearance of these MUI tabs, specifically the tab color and bottom border color. Despite my attempts using makeStyles and other methods, I haven't been able to achieve the desired result. https://i.sstatic.n ...

Positioning a div above a Bootstrap navbar that disappears when scrolling

I am currently using bootstrap to design a website, and I am attempting to create a div that would initially appear above the navbar on an unscrolled webpage. However, once the user starts scrolling, I want this div to disappear and have the navbar fill it ...

How can I ensure that PrimeNG is functioning properly?

I'm encountering some difficulties setting up PrimeNG correctly to utilize its rich text editor. Despite installing all the necessary components, it's still not functioning as expected. https://i.stack.imgur.com/4kdGf.png This is my package.jso ...

Make the text return to its original state once the checkbox has been marked

I'm a beginner in CSS and JavaScript, and I've been attempting to change the text appearance from bold to normal when a checkbox is clicked, but so far, I haven't been successful... Initially, the text includes some bold words, but after cli ...

What is the process for adjusting the width of the horizontal scrollbar track?

I'm currently working on creating an image slider with a scrollbar positioned at the bottom. The main idea is to display the images in fullscreen mode with the active image centered, flanked by two other images on each side. One challenge I faced was ...

Tap on the link but remain on the anchor

I'm having a problem with my navbar that uses anchors instead of links. Whenever a user inputs something into the chat and hits enter, they get redirected to the first anchor. I believe I need to implement AJAX to resolve this issue, but I'm stru ...

What is the best way to dynamically update or display unique CSS styles when a service is invoked or provides a response in AngularJS using JavaScript

Seeking to display a unique CSS style on my HTML FORM prior to invoking a service in my code and then reverting back after receiving the response. I have implemented the use of ng-class to dynamically add the class when the boolean activeload1 is set to tr ...

Optimizing Bootstrap 4 Carousel for various screen sizes

I want to implement a full screen bootstrap 4 carousel with a transparent navbar at the top. The provided code seems to be functioning correctly. HTML: <!doctype html> <html lang="ro"> <!-- START head --> <head> &l ...

Show Struts2 error message on an HTML webpage

I have included error and message handling in my Struts2 action class using the addActionMessage and addActionError methods. I am now looking for code that will allow me to display these messages and errors on the HTML page. Is it feasible to do so? ...

Determine the total cost based on the quantity purchased

I created a webpage for employees to select an item from a dropdown menu, and it will automatically display the price of that item. Check out my code below: <script> $(document).ready(function() { $('#price_input').on('change' ...

How can I align a div in a vertical manner if it is displayed as a circle?

This is the creation I have come up with: This is the design I am aiming for: Below is the code I have written: <div id="OR"><span style=" vertical-align: middle;background:blue;">OR</span></div> Here is the corresponding CSS: ...

Ajax is functioning properly on Internet Explorer and Safari, however it is not functioning on Firefox, Chrome, or Opera

I am attempting to retrieve modal data from an HTML page using jQuery Ajax. It seems to be functioning properly in Safari and IE 6, however I'm encountering issues in Firefox, Chrome, and Opera. Any suggestions on how to resolve this? You can find my ...

What are the steps to make a counter-clockwise dial with jQuery Knob?

Is there a way to use multiple instances of jQuery.countdown? Can I create countdown circles using jQuery Knob? Find examples here and here. Using Multiple instances of jQuery.countdown <div data-countdown="2016/01/01"></div> <div data-co ...

When the field is clicked into for the second time, the month and year picker values will update

I recently implemented a month and year date picker code I found on a website. While I was able to customize the date format (mm/dd/yy) and successfully select values, I encountered an issue where the selected date changes drastically when clicking away fr ...

Ways to incorporate a dynamic HTML form that allows for input elements to be added both horizontally and vertically while maintaining connected lines

Looking to design a form that showcases HTML elements in both vertical and horizontal positions, with lines connecting them as seen in this example: https://i.sstatic.net/jB12f.png. Can anyone offer guidance on how to achieve this? Thanks! ...

Developing a desktop app using HTML5

I'm starting out with HTML (specifically HTML5) and I'm interested in developing a desktop widget using HTML5 without having to rely on running it within a browser. Are there any software development environments available that can assist with th ...

(Bootstrap) Implementing inline block properties to ensure consistent column display

I am currently working on improving the column layout of a website. However, I am facing an issue where there are large blank spaces if the text lengths or image sizes vary. To test out the theme, I have included some sample products in the image below. h ...