CSS中的弹性盒子

本来应该是两个段落的内容可以横向排列在容器中。主要依靠display: flex;来实现。示例如下:

<!DOCTYPE HTML>
<html>
<head>
	<style>
		.container {
			border: solid 2px #806868;
			display: flex;
			height: 100px;
		}
		.item {
			border: 2px solid #457081;
			margin: 10px;
		}
	</style>
</head>
<body>
	<div class="container">
		<p class="item">第一段</p>
		<p class="item">第二段</p>
	</div>
</body>
</html>
展开/折叠结果

第一段

第二段

评论

发表评论

了解 数据控|突破是我们的每一步 的更多信息

立即订阅以继续阅读并访问完整档案。

继续阅读