Creating responsive images with Bootstrap 5

1

I am currently using Bootstrap 5 to develop a website and encountering an issue with getting images to move above text in the feature and mission sections on mobile or tablet screens. Previously, I was able to achieve this effect using the following code snippet on a specific page:

<div class="col-md col-12 order-1 order-md-0">
      <h3 class="display-3 text-start" pt-5>General Support</h3>
      <br>
      <p class="text-start">
        Sit nisi ipsum sint incididunt qui amet cupidatat quis qui adipisicing excepteur ea consequat consequat. Anim qui non ex labore enim non Lorem. Sint sint consectetur magna quis proident anim. Ipsum dolor voluptate do veniam exercitation mollit quis adipisicing commodo labore voluptate cupidatat aliquip. Sint sit culpa nostrud laboris voluptate Lorem cupidatat.
        <br />
        <br />
        Proident deserunt nulla aliquip sint dolor. Labore qui quis cillum deserunt voluptate et nostrud et elit reprehenderit. Deserunt aliqua sint esse elit proident do excepteur proident anim. Adipisicing magna magna ullamco do ea in consectetur aliqua aliquip sint excepteur ex. Reprehenderit magna officia adipisicing exercitation qui sint amet fugiat et ipsum amet velit consectetur commodo. Eu duis laboris eiusmod ad quis ut voluptate. Nisi amet quis do laborum occaecat non mollit sunt.
        <br />
        <br />
        Culpa laborum occaecat exercitation deserunt nulla laboris est. Aliqua culpa et qui non mollit cupidatat excepteur. Labore ea ipsum sit est ipsum commodo velit...

        </div>
      </div>

However, I am now struggling to replicate this functionality on another part of my website.

Below is the code snippet where I am trying to add the moving image functionality:

<!-- FEATURE SECTION START -->
    <section>
      <div class="container">
        <div class="row bg-white  mt-1 px-2">
          <div class="col-lg-6 col-sm-12 order-sm-1">
            <img src="./src/img/feature-section.jpeg" alt=" logo" class=" img-fluid rounded float-start mb-2 img-fluid mt-1" id="#team-img"/>
          </div>
          <div class="col-lg-6 col-sm-12 order-sm-2">
            <h2 class="display-6" id="about-heading">About Us</h2>
            <hr>
            <p class="lead mt-5">
              Ullamco nostrud ipsum laboris sint commodo. Do duis veniam culpa tempor veniam laboris dolor amet minim qui incididunt ipsum. Magna proident commodo ea do eiusmod amet cu...
            </p>
            <a href="./about#about" class="btn btn-primary mt-3" id="button">Read&nbsp;More</a>
          </div>
        </div>
      </div>
    </se...</questionbody>
<exquestionbody>
<div class="question">
                
<p>1</p>
<p>I am using Bootstrap 5 to create a website and in my feature and mission sections I want the images to move above the text when the viewport is mobile or tablet size, but I am not sure how to accomplish this. For example, on one page of my site, I did this to achieve the same functionality mentioned above:</p>
<pre><code><div class="col-md col-12 order-1 order-md-0">
      <h3 class="display-3 text-start" pt-5>General Support</h3>
      <br>
      <!-- <br> -->
      <p class="text-start">
        Sit nisi ipsum sint incididunt qui amet cupidatat quis qui adipisicing excepteur ea consequat consequat. Anim qui non ex labore enim non Lorem. Sint sint consectetur magna quis proi...

      
          </div>
        </div>
    </section>
    <!-- FEATURE SECTION CLOSE -->

    <!-- MISSION SECTION START -->
    <section>
      <div class="container"...

Answer №1

After reviewing your code in a bootstrapped sandbox on my local machine, everything looks solid. Unfortunately, I don't have access to your CSS file. If you're able to provide that, I can assist in creating a codepen for you.

In regards to your question about image repositioning, they now appear above the text as per your request (within the container/columns). If you're experiencing any issues with this, double-check your bootstrap call - it should resemble the following:

<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="02606d6d76717670637242372c332c31">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">

If you could share the CSS with us, or if this response was helpful to you, please let us know. Wishing you the best of luck with your project.

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

Tips for utilizing an adaptive design with Angular

I am working on designing a page that allows for scrolling if needed. On each section of the page, I will be incorporating specific components with unique colors to enhance the layout. However, my current HTML code is not producing the desired result as sh ...

Difficulties encountered when trying to send emails on iPhone with HTML formatting and attachments

I'm attempting to send a JPG attachment along with a formatted HTML message using [picker setMessageBody:emailBody isHTML:YES]; as recommended by several forum posts. However, what I've noticed is that the resulting email's content varies d ...

Idea: Develop a bookmarklet that generates a header form and deletes it upon submission

After much contemplation and experimentation, I have been grappling with the idea of creating a bookmarklet that displays a header when clicked on any webpage. This header will contain a small form that submits its contents to a server before disappearing. ...

Can someone please clarify how the nth-of-type selector functions?

I can't understand why the nth-of-type selector needs to be set to 2 instead of 1 for the first sibling of this type in the code. To see the code in action, check out this jsfiddle: https://jsfiddle.net/xj5hvn16/ If anyone could kindly provide an ex ...

"Troubleshooting problems with jQuery accordion collapse and styling using CSS

I'm currently dealing with an issue regarding my accordion design. I have customized the stylesheet using themeroller, but when I collapse one of the sections, the header changes to black instead of reverting back to its original red color. I've ...

Hiding loading spinner in Ionic 2 upon iframe completion

I need to embed an external webpage in my app using an iframe. I have successfully implemented a loading animation while the iframe is loading, but I am unsure how to hide the animation once the iframe content has loaded. Unfortunately, I am unable to edit ...

What do I do when I encounter the error message "Provider not found for RadioControlRegistry" in Angular 2? Which provider should

Which provider should be included in the provider component? <div class="radio"> <input let match id="male" type="radio" name="gender" value="true" [(ngModel)]="isMatching" (click)="isMatching(match.value)" > Take a look at my console output ...

The operation of 'val' is not supported by HTMLInputElement

While working with a table row, I am iterating through each cell. Inside every cell lies a text box containing some value that I need to store in an array. function dothing() { var tds = $('#'+selected+' td'); var submi ...

applying hover effect to text within a table

After investing some time into solving this issue, I am still struggling to find a solution. Essentially, what I want is for the :hover pseudo-class to trigger the border-bottom effect only when I hover over the text in a table. Currently, the :hover pseu ...

When utilizing jQuery lightbox to pull data from a database using PHP/Ajax, it may require a double click the

Encountering a strange issue where I must click on specific buttons with unique IDs. These IDs are then sent through Ajax to a PHP script, which searches for corresponding entries in the database. The retrieved data is then displayed in a jQuery lightbox. ...

Creating a CSS animation to slide a div outside of its container is

I currently have a flexbox set up with two adjacent divs labeled as DIV 1 and DIV 2. By default, both DIV 1 and DIV 2 are visible. DIV 2 has a fixed width, occupying around 40% of the container's width. DIV 1 dynamically adjusts its width to ac ...

Obtain the identifier for a single button within a collection of buttons in an HTML form using Django

I've incorporated Django as the framework for a tracking platform, utilizing it as an FSM. At this juncture, I aim to enable users to modify the machine's state. The state is denoted by a django-fsm field, essentially a CharField integrated with ...

Spin a Material UI LinearProgress

I'm attempting to create a graph chart using Material UI with the LinearProgress component and adding some custom styling. My goal is to rotate it by 90deg. const BorderLinearProgressBottom = withStyles((theme) => ({ root: { height: 50, b ...

Tips for dynamically filling HTML content with Ajax calls

I'm currently in the process of creating a website for my semester project, and I need to dynamically populate HTML content from an AJAX response. The data I'm receiving is related to posts from a database, but I specifically need to display 5 jo ...

Initiate playing HTML video upon user click

My current situation is quite straightforward. I have an HTML video that plays when I click a div with the class ".play". $('.play').click(function() { $('.video').get(0).paused ? $('.video').get(0).play() : $('.vide ...

Google Chrome is unable to render a .eps file

Is there a way to include the "Download on the App Store" badge on my website? I downloaded the file as a .eps and it shows up correctly in Safari but not in Chrome. <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> ...

What is the best way to showcase the contents of an array of objects from JavaScript on an HTML page in a dynamic

Looking for guidance in Javascript as a beginner. For an assignment, I need to create two separate JS files and use them to display data dynamically on an HTML page. One JS file, named data.js, contains an array of objects representing a product catalog. T ...

Having trouble with selecting checkboxes in a div using jQuery? While it may work in IE and Firefox, Chrome seems to be causing issues

In my div, I have several checkboxes placed under labels for formatting purposes. There is a list of checkbox names that need to be checked upon certain actions. Here is the list: var columns= ['2','5','4'] This is the curren ...

Customize the appearance of the 'Update' or 'Publish' WordPress button using code from functions.php or style.css

Current issues with permissions to core files and stylesheets are prompting me to seek ways to customize the LOCATION and APPEARANCE of the 'Update / Publish' button in Wordpress CMS posts/pages. Any tips on how to achieve this despite the challe ...

Utilize a Chrome Content Script to intercept jQuery delegated event handlers and take control

After developing a Chrome extension that intercepts form submissions in specific circumstances, I encountered an issue with a particular website utilizing jQuery's delegate function. My extension is built with raw JavaScript, excluding jQuery to prev ...