弹性盒子实现圣杯布局
来源:3-7 布局-解题-3

木头就是我呀
2020-09-17
如果使用弹性布局的话可以实现先加载内容的功能吗
body {
min-width: 550px;
}
#header {
text-align: center;
background: #F1F1F1;
}
#container {
display: flex;
}
#center {
background: #ccc;
flex: 1;
}
#left {
background: yellow;
width: 200px;
}
#right {
background: red;
width: 150px;
}
#footer {
text-align: center;
background-color: #f1f1f1;
}
....
....
<div id="header">this is header</div>
<div id="container">
<div id="center" class="column">this is container</div>
<div id="left" class="column">this is left</div>
<div id="right" class="column">this is right</div>
</div>
<div id="footer">this is footer</div>
这样可以实现内容居中吗
写回答
2回答
-
弹性布局,不好实现内容先加载。
因为一般都是左中右的设置方式,对应到 html 代码,肯定是左侧的先写、然后中间的,最后右侧。
212020-09-18 -
松树下的熊猫
2020-09-18
你可以试下 是这样的
00
相似问题