Bootstrap 4 ordering feature is non-functional

I am looking to rearrange the layout for Desktop and mobile devices, currently this is how it's structured:

On Med+ :

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

On small:

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

The placement on Desktop is fine. However, on mobile I want the image to appear below the button and text. I've tried using order-sm-first, order-sm-last, and even order-1 to order-2, but nothing seems to be working. Unsure of what I might be missing:

<section class="feature section">
<div class="container">
    <div class="row">
        <div class="heading">
            <h2>Try it now!</h2>
        </div>
        <div class="col-md-5 order-md-last">
            <img src="The image url is here"
                class="" id="generated-monKey" alt="">
        </div>
        <div class="col md-2 order-md-1">
            <br>
        </div>
        <div class="col-md-5 order-md-first text-center">
            <p>Enter a Banano wallet address and press the "Generate monKey" button.</p>
            <br>
            <p>If you do not have a Banano wallet you can create one in BananoVault or simply generate a random Banano
                wallet address.</p>
            <br>
            <div class="container">
                <input type="text" class="form-control form-rounded" placeholder="Banano Address" maxlength="64" size="65">
                <br>
                <div class="container">
                    <div class="row">
                        <form>
                            <div class="checkbox col-md-6">
                                <label>
                                    <input type="checkbox" value="" checked>Accessories</label>
                            </div>
                            <div class="checkbox col-md-6">
                                <label>
                                    <input type="checkbox" value="" checked>Background</label>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <br>
            <button type="button" class="btn btn-lg btn-success form-rounded" border>Generate monKey</button>
            <br>
            <br> Monkeys are perfect for avatars. Click on the monKey image in order to download it.
        </div>
    </div>
</div>
</section>

In this instance, I used the 'md' tags for first and last to ensure that even on Desktop the image should display on the right and the text on the left, however, the layout remains unchanged.

Answer №1

Your HTML structure could use some cleaning up. Here are a few suggestions from me:

  • Avoid nested container elements.
  • Place cols directly after row.
  • Fix the missing hyphen in col md-2. And why have a column wrapping a <br> tag?

Improved HTML structure

<section class="feature section">
    <div class="container">
        <div class="heading"></div>
        <div class="row">
            <div class="col-md-6">
                <form />
            </div>
            <div class="col-md-6 order-md-first">
                <img />
            </div>
        </div>
    </div>
</section>

fiddle: http://jsfiddle.net/aq9Laaew/144878/

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

Text that only occupies a portion of the screen width

My unordered list (ul) contains three list items (li). The first li element displays the text "opptakskrav" and the last li element displays "ja". Can anyone explain why the text in my second li element does not use the full width and starts a new line hal ...

Avoid jQuery ContextMenu Submenu Items from Expanding in Size on Mobile Devices

Recently, I started using the jQuery contextMenu which can be found at . The issue I encountered involves a menu with a submenu. Whenever I try to access the submenu items on mobile Safari or Chrome, the size of the menu items suddenly doubles and gets cu ...

Avoiding divs from crashing into each other

I've developed a game feature that allows users to chat. Each message is displayed as an absolute positioned element in the body with user x position set as the "left" CSS property. These messages are animated to move to the top of the screen. I want ...

Using PHP's modulus operator, you can dynamically apply CSS classes to a grid of images based on alternating patterns

Exploring the use of modulus to dynamically apply a CSS class to images displayed in a grid under different scenarios: Situation 1 In this situation, the goal is to target and apply a CSS class to middle images marked with *. Since the number of images ...

Issue with jQuery Cycle causing images not to load in IE all at once, leading to blinking

When using the jQuery Cycle plugin in IE8 (as well as other versions of Internet Explorer), I am encountering an issue. My slideshow consists of 3 slides, each containing a Title, Description, and Image. The problem arises when viewing the slideshow in I ...

I am looking to create a header design that is fully responsive and resembles the example shown in the image. How can I achieve

Currently, I am working on creating a responsive header for a website. The image provided is a rough draft of the header design that I am aiming to achieve. I attempted to form the shape using an SVG path but encountered difficulties in making it fully res ...

The button's color doesn't seem to change to the correct one when clicked

Despite my efforts, I can't seem to get the button border to match the color of the hover state. I've tried using the focus selector and even the active state, but nothing seems to work. Below is the relevant code snippet from the project, and yo ...

Having trouble displaying a local image in CSS using EJS

Hey there, I'm currently working with EJS. In my CSS file, I've added a background image but it's not showing up when the page loads. Strangely, if I use a hosted image, it works perfectly. Here is my directory structure: https://i.sstatic ...

Are the navigation links at the bottom of the sidebar?

I've been experimenting with positioning three navigation links at the bottom of a sidebar I created, but I'm having trouble getting them there. Despite my attempts, I can't seem to figure out how to make it work. The background of the nav ...

Modify the size of a div based on the status of a checkbox using only HTML and CSS

Here is a small project that I created using only HTML & CSS. The goal is to modify the properties of the <div class="pro"> when the checkbox is checked. When this happens, all other <div class="pro"> elements should be hidden and the <art ...

The dropdown feature in the bootstrap4 navbar causes the navigation items to shift and adjust their

I am currently working on a navigation bar using Bootstrap4 and I've added a nav-item button to dropdown a menu. However, the issue I'm facing is that when the menu drops down, it pushes other nav-items around, causing them to change position. Th ...

What causes the cursor to shift when I attempt to restrict the length of the bootstrap button text?

Take a look at these Bootstrap-styled buttons: body { margin: 10px !important; } button.limited-text-length span.text { width: 50px; display: inline-block; overflow-x: hidden; } <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/b ...

Is there a way to seamlessly transition between images in a slider every 3 seconds using javascript?

<!DOCTYPE html> <html> <head> <title>Hello</title> <meta http-equiv="Content-Type" type="text/html" charset="UTF-8"/> <style> *{margin:0; padding:0;} .mySlides{ position:relative; width:1000px; ...

The primary objective of utilizing margin

Just embarked on my journey to mastering HTML and CSS. Regarding the 'margin' property: Does its primary function revolve around centering elements horizontally on a webpage? I've crafted a navigation menu for a website, yet I struggle to ...

Is there a way to alter the appearance of an HTML element without an ID using a JavaScript function?

I have a specific goal in mind, but I'm struggling to articulate it concisely. Despite conducting extensive research, none of the suggested solutions seem applicable in my case. Objective: I aim to change the background color of a div based on the da ...

Failed to load CSS file in nodeJS application

I followed a tutorial to create a backend app using nodeJS and Express. My MongoDB connection with Mongoose is working fine. However, I am facing issues when trying to add a simple front-end using html/ejs/css. The endpoints are loading on localhost but on ...

Animation of scrolling in a horizontal layout

Currently, I am utilizing ng-repeat 1.4 to dynamically generate elements within a div that has polymer shadow classes and uses the 'layout horizontal' style, resulting in code similar to: <div class='layout horizontal'> < ...

simultaneous image hover effect for all images

I am experiencing an issue with my CSS and Bootstrap hover effect. The overlay tags are enclosed within a div class, but they all hover simultaneously. Each overlay belongs to a different Bootstrap grid, yet the effect extends even to the empty spaces betw ...

Adjusting Animation Timing for Hovering over Div Elements

I'm struggling to maintain the rollover image (e.g. .rolled-thumb-1) displayed after rolling off the image thumbs. I expected it to work using the transition delay property just like in this demo, but unfortunately, that's not happening. When rol ...

Create an HTML document with a bottom section that shows up on every page when printed

I am currently working on creating a footer for an HTML file where the requirement is to have the footer displayed on each printed page. I came across a solution that fixes specific text to every page that I print. Here is the code snippet: <div class ...