【发布时间】:2019-12-28 08:10:30
【问题描述】:
如何让flexbox 做出响应?
所以我使用flexbox 和两个 div,一个用于左侧,一个用于右侧。
屏幕就像分割的一样,左边是图像,右边是信息和输入。
但如果ajax 加载更多数据,左侧没有响应,则图像下方会出现空白。
我的 HTML:
<div class="forny-container">
<div class="forny-inner">
<div class="forny-two-pane">
<div></div> <!-- form div -->
<div></div> <!-- image div -->
</div>
</div>
</div>
我的 CSS:
.fo-container {
display: block;
align-items: center;
height:100%;
}
.fo-inner {
display: block;
height: 100%;
width: 100%;
}
.fo-two-pane {
height: 100%;
display: flex;
flex-direction: row-reverse;
}
.fo-two-pane > div {
flex: 1;
}
.fo-two-pane > div:first-child {
display: flex;
align-items: center;
background: white;
}
.fo-two-pane > div:last-child {
background: url('http://getwallpapers.com/wallpaper/full/9/9/0/722477-best-barber-wallpapers-1920x1080-samsung-galaxy.jpg') center center no-repeat
hsla(31, 80%, 93%, 1);
display: none;
}
如果ajax 将更多数据或错误消息加载到表单 div 中,则图像下方会出现空白:
出了什么问题?
【问题讨论】:
-
你想做这样的事情吗? stackoverflow.com/a/57642783/1210271
标签: css responsive-design flexbox