Welcome to OGeek Q&A 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 Reply

0 votes
by (71.8m points)

给father的父元素设置dispaly: flex

.grandfather {
  dispaly: flex;
}

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...