Troubleshooting Bootstrap 4 .form-inline compatibility issue on Internet Explorer 11

My application has a form styled with Bootstrap 4 that looks how I want it in all browsers except for Internet Explorer 11.

To achieve the layout, I used Bootstrap's .form-inline class as suggested in the documentation.

The .form-inline class is recommended to showcase labels, form controls, and buttons on a single horizontal row.

The form should render like this. Here's a screenshot from Chrome v80:

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

In IE 11, however, it appears differently.

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

This is the markup being used:

<div class="row">
    <form method="get" class="form-inline" action="#"> 

        <div class="col">   
            <label for="date_start" class="mr-2 float-left">From</label>
            <div class="input-group date mr-5" id="dateStart" data-target-input="nearest">
                <div class="input-group-append" data-target="#dateStart" data-toggle="datetimepicker">
                    <div class="input-group-text"><i class="fa fa-calendar" aria-hidden="true"></i></div>
                </div>
                <input type="text" name="dateStart" value="2020-03-17" class="form-control datetimepicker-input" data-target="#dateStart" autocomplete="off">  
            </div>
        </div>

        <div class="col">
            <label for="date_end" class="mr-2 float-left">To</label>
            <div class="input-group date mr-5" id="dateEnd" data-target-input="nearest">
                <div class="input-group-append" data-target="#dateEnd" data-toggle="datetimepicker">
                    <div class="input-group-text"><i class="fa fa-calendar" aria-hidden="true"></i></div>
                </div>
                <input type="text" name="dateEnd" value="2020-03-24" class="form-control datetimepicker-input" data-target="#dateEnd" autocomplete="off">  
            </div>
        </div>

        <button class="btn btn-primary btn-md-top-pad">View Notifications <i class="fas fa-chevron-right" aria-hidden="true"></i></button>

    </form>
</div>

If I remove the .form-inline class in IE 11 using Developer Tools, the layout improves but still isn't perfect.

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

I came across an issue regarding inline-flex elements breaking to new lines in IE11 and tried replacing my .row with a .container. This resolved some issues but centered the form, which isn't ideal in other browsers. It also made the input fields longer than desired.

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

Is there a way to keep the form left-aligned and on one line while fixing this problem specifically for IE 11 without breaking compatibility with other browsers? I aim to maintain consistent rendering like the first screenshot across all browsers.

Answer №1

Upon comparing with the official demo, I discovered that the issue lies within the <div class="col">. Unlike the official demo, the elements in the form were not enclosed by div .col. Once these were removed, the functionality worked seamlessly on IE 11 and other browsers.

For an online demonstration, check out this link.

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<form method="get" class="form-inline" action="#">

  <label for="date_start" class="mr-2 float-left">From</label>
  <div class="input-group date mr-5" id="dateStart" data-target-input="nearest">
    <div class="input-group-append" data-target="#dateStart" data-toggle="datetimepicker">
      <div class="input-group-text"><i class="fa fa-calendar" aria-hidden="true"></i></div>
    </div>
    <input type="text" name="dateStart" value="2020-03-17" class="form-control datetimepicker-input" data-target="#dateStart" autocomplete="off">
  </div>

  <label for="date_end" class="mr-2 float-left">To</label>
  <div class="input-group date mr-5" id="dateEnd" data-target-input="nearest">
    <div class="input-group-append" data-target="#dateEnd" data-toggle="datetimepicker">
      <div class="input-group-text"><i class="fa fa-calendar" aria-hidden="true"></i></div>
    </div>
    <input type="text" name="dateEnd" value="2020-03-24" class="form-control datetimepicker-input" data-target="#dateEnd" autocomplete="off">
  </div>

  <button class="btn btn-primary btn-md-top-pad">View Notifications <i class="fas fa-chevron-right" aria-hidden="true"></i></button>

</form>

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

Ways to include a div class in JQuery

Hey there! I'm currently working on incorporating the bootstrap panel head and body using JQuery. Here is a snippet of my HTML code: <div class="panel panel-default"> <div class="panel-heading"> <h3 class="pan ...

Display SVG at full size without any distortion

How can I make the SVG image 100% by 100% without scaling? I want the image to be centered on the page both horizontally and vertically. The challenge is that I also want to display the areas outside of the SVG artboard, so using CSS to center it won&apos ...

The function SVGGeometryElement.isPointInFill() may not function correctly in Chromium, but it does work properly in Firefox

I'm currently working on a solution to detect when a path within an SVG file on a canvas has been clicked. The code I've written functions correctly in Firefox, but I'm encountering issues with Chromium browsers. When I surround the code wit ...

Using Asp.net C# to submit information with a button and navigate within the page

A unique feature I am looking to implement on a page involves a basic textbox form within an "InputSection" where users can input data. After entering their information, the user can click on a preview button (asp button) located at the bottom of the form. ...

Guiding the jQuery Document

I currently have a stylesheet in the head section with the following content: *, body { direction:rtl; } Upon inspection, I found that the dir variable of jQuery is set to ltr: $(function(){ alert(this.dir); }); How can I obtain the specific page di ...

Tips for showing an image in a pop-up window using Window.open

I'm attempting to show an image in a popup window using the following JavaScript code: function newPopup(url) { popupWindow = window.open( url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=no,t ...

Ways to align content in the middle vertically with Bootstrap v5.2

I am attempting to recreate the vertical centering layout of this website for my own site, but I am struggling to keep my content centered in the viewport. Expected outcome: https://i.sstatic.net/0yCyg.png My code: https://i.sstatic.net/1omTV.png The ...

Styling with CSS: How to Show an Absolutely Positioned Element in Google Chrome

I'm currently working on a CSS design that involves positioning an image within a span tag. Here's the CSS code I have: .dc-mega-icon { background-image: url(...); display: inline-block; position: absolute; top: 18px; width: ...

Sending information to a server using JavaScript

Greetings everyone, this is my first time posting here and I would appreciate detailed guidance in your comments. Just a little background about myself: I am a second-year college student with one year of Python training. I only recently started learning ...

The mechanics of citing two different stylesheets

Just delving into the world of HTML and I'm attempting to link 2 items with href. Surprisingly, I don't receive an error message, but my style.css file refuses to cooperate. Any suggestions? <link rel="stylesheet" href="https://maxcdn.bootstr ...

Sending a document from a web browser to a label printer and customizing the size of the print area

Seeking advice on how to format content for printing from a browser onto a 2.4"x4" label. When using word processing software like Pages, I can easily adjust the document size and print with confidence that it will fit perfectly on the label. However, ach ...

Enhancing nouislider jQuery slider with tick marks

I have integrated the noUIslider plugin () into one of my projects. I am seeking guidance on how to display tick marks below each value on the slider. This is the current initialization code for the slider: $slider.noUiSlider({ 'start': sta ...

What is causing the classList function to throw an error: Uncaught TypeError: Cannot read properties of undefined (reading 'classList')?

There's an error that I can't figure out: Uncaught TypeError: Cannot read properties of undefined (reading 'classList') console.log(slid[numberArray].classList) is working fine, but slid[numberArray].classList.add('active') is ...

Firefox is having trouble fetching #header from style.css, but other web browsers seem to be working fine

Visit my website at http://dayforfailure.com My website appears fine on Chrome and Safari, but on Firefox the header and other elements are not displaying correctly. It seems like there may be a cross-browser compatibility issue. I am new to dealing with ...

Challenge with AngularJS ng-select and ng-switch-when functionality

Struggling with implementing a selection menu on my angular charts, I encountered some challenges. The selection app template I used only displays the selection menu and graph axis on the page. Checking the console log for errors, I noticed one src URL wa ...

What is the best way to ensure that content fills the entire screen?

My goal is to position the footer at the bottom of the page. This is the initial code I tried: <html> <head> <title>Freds Cars, Trucks & Jeeps</title> <style> #container{ height: auto; ...

Why are the icon pictures not displaying in Angular's mat-icon-button?

Recently, I stumbled upon a snippet of code in an Angular project that caught my eye. Naturally, I decided to incorporate it into my own program: <div style="text-align:center"> <a mat-icon-button class="btn-google-plus" href="http://google.com ...

HTML table designed to work in both Internet Explorer and Firefox, with a header and footer that remain fixed while allowing vertical and

I am in need of a highly functional HTML super-table. I am open to using jQuery or any other JavaScript library, regardless of potential drawbacks, as long as it meets the following requirements. It must support: Compatibility with at least IE8 and the ...

Are there any drawbacks to utilizing data attributes for modifying content through JavaScript?

On my journey of developing a basic web app, I am faced with the challenge of updating data displayed on the screen based on certain events or conditions. The data is spread across various locations and embedded in completely different markup structures. I ...

Show the checkboxes' names listed in an array

I am having trouble displaying the names of my checkboxes using the foreach statement below. Currently, all I see is "on" for each checked box. I have included the code for one of the checkboxes and I am looking to see if there is anything I can modify i ...