Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.6k views
in Technique[技术] by (71.8m points)

关于一个带sliderBarde flex布局

现在是这样的 flex布局分三列 两端固定,中间自适应,父元素flex

father {

display: flex;

}
left {

width: 458px;

}
right {

height: 458px;

}
center {

flex: 1;

}
现在的问题是 在父元素左边有个sliderbar 向右边展开的时候,center不压缩 而是整个父元素整体向右边推,产生一个滚动条 蛋疼 如何解决


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

给father的父元素设置dispaly: flex

.grandfather {
  dispaly: flex;
}

.grandfather .father {
  flex: 1;
  display: flex;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...