LoginSignup
7
7

More than 5 years have passed since last update.

このなかにabsoluteなflexをするとwidthが取得できないブラウザがいます〜

Posted at

ライブデモはこう https://jsfiddle.net/hskuych3/

HTMLがこうで、

<div class="flex">
    <div>LOREM</div>
    <div>IPSUM</div>
</div>

CSSはこう。

.flex{
    position:absolute;
    display:flex;
    width:100%;
}
.flex>div{
    flex:1;
    border:1px solid red;
}

IE11だけflexがwidthを見失ってます。absoluteじゃなければうまくいくみたいだし、ChromeやFirefoxは問題ない。IE11で見た時にグシャーなっててびっくり。

解決法は、absoluteflexに、width:100%widthを明記するだけでした。

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7