Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fix the Flex display in Edge [duplicate]

I have the following:

.flex { display: flex; }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
                                                                    rel="stylesheet"/>
<div class="flex">
  <input class="form-control" />
  <div class="flex">
    <input class="form-control" value="123456789" />
    <input class="form-control" value="123456789" />
  </div>
</div>

Why I can't see the latest input entirely in Microsoft Edge (is OK even in IE), and how to fix it.

like image 596
serge Avatar asked Sep 27 '17 16:09

serge


People also ask

Does Microsoft EDGE support Flexbox?

CSS Flexbox debugging tools. DevTools now support Flexbox layout, as well as Grid layout.

How do I block display flex?

You can add a big margin-right and use flew wrap on the container (as an alternative to the common solution using width:100% or flex:0 0 100% ). With this solution you can also specify a width and other element will always go to the next row (like we do with a block element).

What is Flex display?

Flex is the value of css display . By using display flex in parent elements, child elements automatically align like columns or rows with auto width and auto height.

Does display flex work on all browsers?

Flexbox is very well supported across modern browsers, however there are a few issues that you might run into. In this guide we will look at how well flexbox is supported in browsers, and look at some potential issues, resources and methods for creating workarounds and fallbacks.


1 Answers

If you add min-width: 0; to form-control it work cross browser.

It appears Edge does some other calculation for the input's width, and since the min-width defaults to auto, it won't allow it to be less than its computed width, which min-width: 0 solves.

Will see if I can find some more info about this issue, and when/if, I will update this answer.

.flex { display: flex; }
.form-control { min-width: 0; }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>

<div class="flex">
  <input class="form-control" />
  <div class="flex">
    <input class="form-control" value="123456789" />
    <input class="form-control" value="123456789" />
  </div>
</div>
like image 183
Asons Avatar answered Sep 17 '22 20:09

Asons