I have an IE11 bug which I'm looking to work around somehow.
My setup:
- The is a
div
which I will callouter
which hasdisplay: flex
,flex-direction: column
, andwidth: 100%
. - It contains two other
div
s, which I will callupper
andlower
. upper
contains a number ofinline-block
elements – enough to require some wrapping.lower
contains enough other elements to overflow off the bottom of the screen, and so will get a scrollbar.
What I would expect to happen is that upper
should be big enough to contain all of the inline-block
elements inside it. This works fine in Chrome and Firefox, but in IE11 it isn't tall enough.
This problem also occurs with display: inline
, but not with display: block
(although I think I definitely need inline-block
for my layout).
If I reduce the amount of content inside lower
so that it fits on the screen, the problem goes away.
Any assistance greatly appreciated.
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
.outer {
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
}
.upper {
margin: 0;
background-color: pink;
}
.upper div {
display: inline-block;
width: 10rem;
max-width: 10rem;
color: white;
background-color: red;
}
.lower {
overflow-y: auto;
}
.lower p {
background-color: green;
}
<div class="outer">
<div class="upper">
<div>0</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
<div>19</div>
</div>
<div class="lower">
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
<p>Text</p>
</div>
</div>