css 移动web li 左右两列布局


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
	<style>
		html,body,section{
		width: 100%;
		height: 100%;
		margin: 0;
		padding: 0;
	}
	ul,li{
		list-style: none;
		margin: 0;
		padding: 0;
		width: 100%;
	}
	.box{
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		justify-content:space-between;
		background: darkseagreen;
	}
	.box li{
		width: calc(50% - 5px);
		height: 100px;
		background:mistyrose;
		margin: 5px 0;
	}
	</style>
<body>
		<section>
		<ul class="box">
			<li>1</li>
			<li>2</li>
			<li>3</li>
			<li>4</li>
			<li>5</li>
		</ul>
	</section>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/boyit0/article/details/88973903