主页 > 知识库 > HTML使用栅格布局实现六种筛子样式的代码详解

HTML使用栅格布局实现六种筛子样式的代码详解

热门标签:检查注册表项 智能手机 百度竞价点击价格的计算公式 硅谷的囚徒呼叫中心 阿里云 美图手机 网站建设 使用U盘装系统

先上效果图下面附上代码


<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.big {
				width: 100px;
				height: 100px;
				background: skyblue;
				display: flex;
				margin-top: 20px;
			} 
			.small {
				width: 10px;
				height: 10px;
				background: purple;
				border-radius: 5px;
			}
			
			.one {
				display: flex;
				justify-content: center;
				/*交叉轴*/
				align-items: center;
			}
			
			.two {
				display: flex;
				justify-content: space-around;
				align-items: center;
			}
			
			.two2 {
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				align-items: center;
			}
			
			.three {
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				align-items: center;
			}
			
			.four {
				display: flex;
				justify-content: space-around;
			}
			
			.four1 {
				display: flex;
				justify-content: space-around;
				align-items: center;
			}
			
			.four2 {
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				align-items: center;
			}
			
			.five {
				display: flex;
				justify-content: space-around;
			}
			
			.five1 {
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				align-items: center;
			}
			
			.five2 {
				display: flex;
				flex-direction: row;
				align-self: center;
			}
			
			.six {
				display: flex;
				justify-content: space-around;
			}
			
			.six1 {
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				align-items: center;
			}
		</style>
	</head>

	<body>
		<div class="big one">
			<div class="small"></div>
		</div>
		<div class="big two">
			<div class="small"></div>
			<div class="small"></div>
		</div>
		<div class="big two2">
			<div class="small"></div>
			<div class="small"></div>
		</div>
		<div class="big three">
			<div class="small" style="align-self: flex-start;"></div>
			<div class="small" style="align-self: center;"></div>
			<div class="small" style="align-self: flex-end;"></div>
		</div>
		<div class="big three">
			<div class="small" style="align-self: flex-end;"></div>
			<div class="small" style="align-self: center;"></div>
			<div class="small" style="align-self: flex-start;"></div>
		</div>
		<div class="big four">
			<div class="four2">

				<div class="small"></div>
				<div class="small"></div>
			</div>
			<div class="four2">

				<div class="small"></div>
				<div class="small"></div>
			</div>
		</div>
		<div class="big five">
			<div class="five1">

				<div class="small"></div>
				<div class="small"></div>
			</div>
			<div class="five2">

				<div class="small"></div>
			</div>
			<div class="five1">

				<div class="small"></div>
				<div class="small"></div>
			</div>
		</div>

		<div class="big six">
			<div class="six1">
				<div class="small"></div>
				<div class="small"></div>
				<div class="small"></div>
			</div>
			<div class="six1">
				<div class="small"></div>
				<div class="small"></div>
				<div class="small"></div>
			</div>
		</div>
		<div class="big six">
			<div class="six1">
				<div class="small"></div> 
				<div class="small"></div>
			</div>
			<div class="six1">
				<div class="small"></div>
				<div class="small"></div> 
			</div>
			<div class="six1">
				<div class="small"></div>
				<div class="small"></div> 
			</div>
		</div>
	</body>

</html>

总结

到此这篇关于HTML使用栅格布局实现六种筛子的样式的代码详解的文章就介绍到这了,更多相关html 栅格布局 内容请搜索脚本之家以前的文章或继续浏览下面的相关文章,希望大家以后多多支持脚本之家!

标签:通辽 湖北 山南 湘潭 贺州 怀化 烟台 黄山

巨人网络通讯声明:本文标题《HTML使用栅格布局实现六种筛子样式的代码详解》,本文关键词  ;如发现本文内容存在版权问题,烦请提供相关信息告之我们,我们将及时沟通与处理。本站内容系统采集于网络,涉及言论、版权与本站无关。
  • 相关文章
  • 收缩
    • 微信客服
    • 微信二维码
    • 电话咨询

    • 400-1100-266