0

如何在 flexbox 上嵌入 Yandex.Maps?

我试过这样做,但如果你改变浏览器窗口的宽度——地图的宽度会增加(它会出现水平滚动)。

https://jsfiddle.net/khusamov/91ownd3j/31/

html {
  width: 100%;
  height: 100%;
  display: flex;
}


body {
  padding: 0;
  margin: 0;
  display: flex;
  flex: 1 1 0;
}

#map-wrap {
  display: flex;
  flex: 1 1 0;
}

#map-block {
  display: flex;
  flex: 1 1 0;
}

#map-settings {
  width: 300px;
}

#map {
  width: 100%;
  height: 100%;
}
4

1 回答 1

0

https://jsfiddle.net/khusamov/91ownd3j/43/

html {
  width: 100%;
  height: 100%;
  display: flex;
}


body {
  padding: 0;
  margin: 0;
  display: flex;
  flex: 1 1 0;
}

#map-wrap {
  display: flex;
  flex: 1 1 0;
}

#map-block {
  flex: 1 1 0;
  position: relative;
}

#map-settings {
  width: 300px;
}

#map {
  position: absolute;
  width: 100%;
  height: 100%;
}
于 2020-03-10T14:25:29.230 回答