简短问题:如何在页面中心响应一组动态高度div块。请参阅下面的简化代码:页面中心位于页面响应块的动态高度
长:我有一组数据进入每个块。表格,图形等数据都是由MySQL驱动的,并且整天动态变化,因此这些块的高度不确定并且是动态的。我希望这些块能像自己在示例代码中那样自动定位。基本的响应页面布局。例如:粉色表格可以是50px或5000px。左边的浮动是非常重要的,以便根据需要将多个块堆栈向右移动。
挑战在于块位于页面的中心。我似乎无法弄清楚这一点。
我已经试过并研究过一切。 Flex似乎不支持这个概念。
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.statusC, .statusC2 {
float: left;
}
</style>
</head>
<body>
<div class="statusC" style="height: 300px; width:500px; background-color:pink;">table</div>
<div class="statusC" style="height: 200px; width:500px; background-color:yellow;">progress</div>
<div class="statusC" style="height: 200px; width:500px; background-color:red;">clean</div>
<div class="statusC" style="height: 200px; width:500px; background-color:green;">stat</div>
<div class="statusC" style="height: 200px; width:500px; background-color:blue;">stat2</div>
</body>
</html>
现在我可能会误解,垂直或水平居中? – LGSon
水平又左右 –