LoginSignup
3
1

More than 5 years have passed since last update.

主にFirefoxでflexを使ったときにwidthが効かないときがある

Last updated at Posted at 2019-04-08

HTML


<div class="wrap">
  <input type="text">
  <span>-</span>
  <input type="text">
</div>

SCSS

.wrap {
  display: flex;
  align-items: center;
  width: 300px;
  span {
    display: block;
    width: 20px;
    text-align: center;
  }
  input {
    flex: 1;
  }
}

これだとspanのwidthが効かない

bugfix

.wrap {
  input {
    min-width: 0;
  }
}

多分幅が足りない?押し出されちゃって効かないっぽい。
主にfirefoxで起こる。

デモ:flexを使ったときにwidthが効かないときがある
参考:https://stackoverflow.com/questions/34199345/text-overflow-ellipsis-and-flex-not-working-on-firefox

3
1
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
3
1