The Bootstrap responsive form is experiencing issues with properly displaying columns

I have implemented a simple bootstrap form with rows and columns in groups of 4. My goal was to create 3 total columns using this layout.

Here is the code snippet:

<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ec8e8383989f989e8d9cacd9c2dec2de">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" />


<form asp-controller="Profiles" asp-action="Index" asp-route-returnurl="@ViewData[" ReturnUrl "]" method="post" class="mt-4 pt-2 needs-validation" role="form" novalidate>
  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <div class="card-body">
          <div class="row">
            <div class="col-sm order-2 order-sm-1">
              <div class="d-flex align-items-start mt-3 mt-sm-0">
                <div class="flex-shrink-0">
                  <div class="avatar-xl me-3">
                    <div class="circle">
                      <span class="initials">@Model.NameAbbrv</span>
                    </div>
                  </div>
                </div>
                <div class="flex-grow-1">
                  <div>
                    <h5 class="font-size-16 mb-1">@Model.Username</h5>
                    <p class="text-muted font-size-13">@Model.Roles<br/>@Model.Email</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <hr/>
          <h5 class="mt-4 mb-3">Manage Password</h5>
          <div class="row">
            <div class="col-lg-4">
              <div class="mb-3">
                <label class="form-label">Current Password</label>
                <div class="input-group">
                  <input asp-for="ChangePassword.OldPassword" class="form-control" id="currentPassword" required autofocus />
                  <button class="btn btn-light shadow-none ms-0" type="button" id="toggleCurrentPassword" tabindex="99"><i class="mdi mdi-eye-outline"></i></button>
                </div>
                <span asp-validation-for="ChangePassword.OldPassword" class="text-danger"></span>
              </div>
            </div>
            <div class="col-lg-4">
              <div class="mb-3">
                <label class="form-label">New Password</label>
                <div class="input-group">
                  <input asp-for="ChangePassword.NewPassword" id="newPassword" class="form-control" required autofocus />
                  <button class="btn btn-light shadow-none ms-0" type="button" id="toggleNewPassword" tabindex="99"><i class="mdi mdi-eye-outline"></i></button>
                </div>
                <span asp-validation-for="ChangePassword.NewPassword" class="text-danger"></span>
              </div>
            </div>
            <div class="col-lg-4">
              <div class="mb-3">
                <label class="form-label">Confirm Password</label>
                <div class="input-group">
                  <input asp-for="ChangePassword.ConfirmPassword" id="confirmPassword" class="form-control" required autofocus />
                  <button class="btn btn-light shadow-none ms-0" type="button" id="toggleConfirmPassword" tabindex="99"><i class="mdi mdi-eye-outline"></i></button>
                </div>
                <span asp-validation-for="ChangePassword.ConfirmPassword" class="text-danger"></span>
              </div>
            </div>
          </div>
          <div class="col-lg-4">
            <div class="mb-3">
              <label class="form-label">Update Password</label>
              <button class="btn btn-primary">Update Password</button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</form>

Despite following this structure, I encountered an issue where the third column breaks into a new line. Can anyone identify what might be causing this problem? I have spent several hours troubleshooting but have been unable to locate the error. Any assistance would be greatly appreciated. Thank you!

Answer №1

It appears that you have nested too many elements within each other. Consider simplifying your code by following the suggested format:

<div class='row'>
     <div class='col-4'> first set of code here </div>
     <div class='col-4'> second set of code here </div>
     <div class='col-4'> third set of code here </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

Press the button obscured by an image

Recently on my HTML website, I encountered an issue where I tried adding a transparent image over a button but found that I was unable to click on the button afterwards. The problem seems to be related to the following code snippet: #container { heigh ...

Utilize Bootstrap's form-inline feature to arrange fields side by side in one neat

I am looking to customize my sign-in form layout by displaying the fields in a row next to each other rather than under each other. header: Update: I have successfully implemented this code <header class="navbar navbar-fixed-top navbar-inverse"> & ...

What is the best way to eliminate data from a channel title using jQuery?

$(function() { $(".track").draggable({ containment:"document", appendTo:document.body, connectToSortable:"#playlist tbody", revert: true, revertDuration: 0, cursor: "move", helper: "clone", ...

Applying cursive style to text within an HTML text field

Just a quick question: Here's the code snippet I'm working with: <tr> <td><b>Item name:</b></td> <td><input type="text" name="Receptnr" value="<i>Enter values here</i>"></td> ...

Submitting a form using ajax to send form data to php without reloading the page

Could anyone please help me figure out why my code is not functioning properly? I am trying to send form data to PHP using the post method, but my PHP script is not receiving any requests. Below is the code snippet for my signup form located in signupmodal ...

Whenever I try to install the PostCSS plugin in Tailwind CSS and run "npm run build," an error always pops up. I've attempted to troubleshoot multiple times without success. Any suggestions on what I should try next?

When using Windows PowerShell, the following commands are executed: cd D:\TailwindCSS cd gs3 npm run build Output [email protected] build D:\TailwindCSS\gs3 postcss ./src/tailwind.css -o ./public/tailwind.css internal/modules/run_m ...

Best practices for displaying output in Python Flask after submitting an HTML form

Embarking on my first web development project, I delved into Flask. Recently, I created a basic temperature converter, running it on my local host. The webpage featured a form input for entering a value, two radio buttons for selecting Fahrenheit or Celsiu ...

Adjust the checkbox dimensions within the cells of a bootstrap table

I am utilizing bootstrap-table along with a column containing checkboxes. I need to adjust the size of the checkboxes in my code to be 25x25 pixels. However, when I try using the height and width CSS attributes, it does not seem to take effect. html < ...

Assistance needed for Internet Explorer

When I designed a webpage in Firefox, everything looked great. However, when I opened it in Internet Explorer and resized the window to less than maximum size, half of the main div disappeared under the footer. If you want to see the issue for yourself, v ...

Unexpected character appearing in Android 2.3, whether using the li or ul tag

Having an issue with my social icons on the top of my website displaying unwanted symbols in Android 2.3. Can't figure out the cause even after ruling out <a> tags and associated CSS. Any thoughts on what the problem might be? I've remove ...

Maintain font kerning for span elements that are not displayed inline

I am looking to add some transform effects to individual letters in a word. To achieve this, I have enclosed each letter within a span element. However, when setting the display of these spans to inline-block, the font kerning gets disrupted. I have exper ...

Expand an image to its full dimensions when it is initially loaded

Currently, I am experimenting with placing images of bubbles randomly on a webpage. To create the illusion of the bubble expanding in size from nothing to its full scale, I have been using CSS and specifically the transform:scale(); property. However, my ...

How to create a clickable image in email HTML when the image is set as a background image for

Is there a way to make an image clickable within an HTML email, even if the image is set as a background-image URL? I would typically wrap the DIV in an "a href", but I am uncertain if this method is supported by email clients. The image is set as a back ...

Automatic Hiding of Dropdown Menu in Twitter Bootstrap: A Quick Guide to Set a 2-Second Timer

Is there a way to make the dropdown menu hide automatically after the mouse cursor leaves the area? If you take a look at Amazon.com for example, when you hover over "Shop by Department" and then quickly move your cursor away and back within about half a ...

Buttons fail to function properly when inserted into Popover

I'm attempting to add 2 buttons to a popover triggered by the .clear-history button: <div class="modal-footer text-nowrap"> <button type="button" class="clear-history btn btn-link">Clear history</button> </div> const c ...

"Learn how to clear an input field using jQuery with this simple guide

I've gone through a few discussions, such as this one and that one, but I'm still struggling to clear the input field after submission. What is the simplest way to achieve this? This is my current approach: $(document).ready(function(){ $(& ...

Creating a stunning visual effect by using CSS to fade images in and out

My current issue involves a UX switch that controls the effect on and off of pictures. http://plnkr.co/edit/JcPXpP0jE5GysBbZbrkp I am trying to achieve a smooth fade transition from one picture to another over 1 second, but I am encountering difficulties ...

Pop-up message on card selection using JavaScript, CSS, and PHP

I have a total of 6 cards displayed in my HTML. Each card, when clicked, should trigger a modal window to pop up (with additional information corresponding to that specific card). After spending a day searching for a solution online, I've come here s ...

The input field cannot be accessed via touch on mobile devices

<div class="form-group row pswrd" style="padding: 0px 10px"> <div id="email" class="col-md-12 col-xs-12"> <input type="password" class="form-control c_fname" id="c" #pswd name="password" placeholder="password" [(ngModel)]="user.passwor ...

Issues with Vertical Alignment and Navigation

Link: Please resize the browser to mobile view. Issue with Header: I am facing alignment issues in the header. The elements do not seem to be aligned properly at the center of the header. The Android logo is aligned, but the text and dash image are not. ...