Troubleshooting alignment issues with flexbox in Internet Explorer 11 and Microsoft Edge

After creating a well-designed ordered list of questions on my website using Bootstrap 4 and flexboxes, I encountered an issue with strange top padding in IE11 and Edge browsers. The list displays perfectly in Firefox and Chrome, but the formatting is off in IE11 and Edge due to this unexpected padding which only disappears when removing the flexboxes.

Here is how the list appears in Firefox and Chrome:

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

However, this is how it looks in IE11 and Edge:

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

For reference, here is a JSFiddle containing the code: https://jsfiddle.net/0g7mpovu

<ol class="mb-0">
  <li class="px-3 py-1">
    <div class="d-flex">
      <div class="d-flex flex-column align-self-center flex-grow-1 w-100">
        How would you describe a surplus in your own words?
      </div>

      <div>
        <div class="dropdown">
          <button type="button" class="btn btn-link" title="Actions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            <i class="fa fa-ellipsis-h text-muted"></i>
          </button>

          <div class="dropdown-menu">
            <a href="#" class="dropdown-item">Edit</a>
            <a href="#" class="dropdown-item">Delete</a>
          </div>
        </div>
      </div>
    </div>
  </li>

  <li class="px-3 py-1">
    <div class="d-flex">
      <div class="d-flex flex-column align-self-center flex-grow-1 w-100">
        What is a fiscal budget?
      </div>

      <div>
        <div class="dropdown">
          <button type="button" class="btn btn-link" title="Actions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            <i class="fa fa-ellipsis-h text-muted"></i>
          </button>

          <div class="dropdown-menu">
            <a href="#" class="dropdown-item">Edit</a>
            <a href="#" class="dropdown-item">Delete</a>
          </div>
        </div>
      </div>
    </div>
  </li>
</ol>

I am seeking advice on how to achieve consistent appearance across all browsers for my list. I am willing to consider alternative formats like tables, as long as the numbering can still be displayed.

Your assistance is appreciated in advance!

Answer №1

Seems like we have encountered a bug.

Here is a potential solution:

Instead of utilizing a block-level flex container (display: flex), try using an inline-level container (display: inline-flex) with the addition of full width (width: 100%).

Add the following code snippet to your existing code:

.d-flex {
   display: inline-flex;
   width: 100%;
}

updated fiddle

I believe this issue may be linked to the referenced post below. However, due to the fact that the problem concerns IE11 and Edge here while Chrome is affected in the other case, I did not mark this as a duplicate.

  • Flexbox inside list item doesn't align to the top of the list item

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

Discovering the maximum font size that can be displayed on a single line in CSS

I am working with a wrapper div tag that has the capability of adjusting its dimensions. <div class="wrapper"> <p class="inside-text">Some text</p> </div> How can I use CSS to set the font-size of inside-text to be as large as ...

Creating visible and invisible containers using CSS

I am facing an issue with the type switcher and containers marked by red rectangles. Each container has its own ID, and when one option is selected in the type switcher, all other containers should be invisible. For example, if the "Furniture" option is ch ...

Dynamic content is not present on the Nivo Slider

I'm having trouble figuring out why the one image is not changing. I've checked for jQuery errors but couldn't find any. Just to clarify, the styling is correct as the client requested it to be a link in case you think there is an issue. T ...

Video autoplay functionality activated by resizing the screen

Greetings everyone, I am excited to share my first post here. After some thorough research, I stumbled upon a piece of code for an external .js file that is almost flawless in its ability to load an image instead of a video if the screen size is less than ...

Ways to resolve flickering caused by css keyframe animation

I'm currently working on creating a staggered opacity effect for three boxes using an infinite keyframe animation and the animation-delay property. However, I've encountered an unexpected issue where the third box seems to fade away and then rea ...

In mobile browsers, the text within the <pre> tags appears extremely small. How can I adjust the font

My issue is with preformatted text that displays correctly on desktop browsers but appears very small on mobile devices in comparison to regular text. Adjusting the size using ems or percent causes it to be too large on desktop screens. Despite searching e ...

I am interested in incorporating a vertical scrollbar into a gridview in ASP.NET

I've successfully bound data to a grid view in my ASP.NET application. I've implemented pagination, but instead of that, I'd like to incorporate a scroll bar to prevent lengthy paging. Below is the code for my grid view: <div class="box ...

What is the best way to display a Bootstrap toggle?

I am facing an issue with a Bootstrap toggle in a Handlebars template. When the page initially loads, the toggle is visible, however, after re-templating the Handlebars template that contains the toggle, it disappears. Before Re-Template: Initial code : ...

Adapting a Bootstrap 3 carousel to Bootstrap 5 causes CSS to malfunction

I found a Bootstrap 3 testimonial slider on Codepen that I am trying to recreate. You can view the original here https://codepen.io/frontendor/pen/abBpXWj After adapting the code to work with Bootstrap 5, the carousel functions correctly but the CSS is no ...

Ways to efficiently display elements in a grid in real-time

Attempting to design a layout where each row consists of 3 cards using Bootstrap's Grid layout for responsiveness. The challenge lies in the fact that the card data is stored in JSON format, and the length of the JSON Object array may vary, leading t ...

Tips for creating CSS Grid elements that stay fixed to the viewport

I am attempting to achieve a 100vh viewport with multiple responsive overlays on top of it. I have managed to fix the header element on the viewport using position: sticky, but I am encountering issues with making the rest work in the same way. Additional ...

Learn how to interact with elements in Selenium ChromeDriver by clicking on them even if they have negative x and y pixel locations

I am currently dealing with a website that features pop-up tables triggered by user interaction. These pop-ups contain important data, but occasionally a technical issue arises where the top of the pop-up window is positioned off-screen, making it challeng ...

Softly Transitioning Slideshow with Slide Effects

Has anyone had any experience with FlexSlider or jQuery in general? I've been using the FlexSlider slideshow script and I've made some customizations to fit my needs. You can check it out here: My main query is, does anyone know how to make the ...

Having an issue with a cropped CSS box?

I have created a CSS box with a red background color, but for some reason the bottom left corner is being cut off. Can you provide an explanation for this issue? (Refer to the image below) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...

What are some ways I can decrease the background width and shrink the div width?

I am hoping to maintain the current box size and borders, but I want to add a touch of color. Specifically, I would like to have a red line running through the center of the box without coloring the entire background. Although I know one way to achieve thi ...

Mobile devices seem to be constantly refreshing website images

I have a landing page consisting of multiple sections with images as the background, each section occupying the full screen. In one specific section, the images change every 5 seconds. The website works smoothly on desktop, but I encounter issues on mobil ...

Responsive images causing Bootstrap Div to become unscrollable

I'm having trouble setting up a gallery section using bootstrap. The scrollspy feature doesn't seem to be creating a scrollable area for the images. Instead, the images are overlapping the borders and running all the way to the bottom of the page ...

Is there a way to align all the values in the center of the row, while ensuring that the div above the row does not have the same width as the row below it? If so, how

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> <script src= ...

Problems with the main title formatting in the header

I am currently working on a new website and have encountered an issue with the header design. The Mainline "PersIntra" is overlapping the "log out button" box, which I would like to be positioned beside it instead. Despite my efforts with CSS and nesting ...

Semi-circle border using CSS

Looking to replicate the circular design shown in the image using CSS. Any tips on achieving this? ...