flex 相关练习骰子

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
*{margin: 0;padding: 0;}
.main{
display: flex;
width: 1400px;
height: 300px;
margin: 100px auto;
align-items: center;
justify-content: space-around;
}
ul{
padding: 10px;
box-sizing: border-box;
list-style: none;
width: 200px;
height: 200px;
border-radius: 20px;
box-shadow: 0 0 5px 0 #999999;
display: flex;
flex-wrap: wrap;
}
ul li{
width: 50px;
height: 50px;
background-color: red;
border-radius: 50%
}
.one{
justify-content: center;
align-items: center;
}
.one li{
width: 100px;
height: 100px;
}
.two{
align-items: center;
justify-content: space-around;
}
.three{
justify-content: space-around;
}
.three li:nth-child(2){
align-self: center;
}
.three li:last-child{
align-self: flex-end;
}
.four{
align-items: center;
justify-content: space-around;
}
.four li{
margin: 0 10px;
}
.five{
align-items: center;
justify-content: space-around;
}
.five li:nth-child(2){
margin-left: 50px;
}
.five li:nth-child(3){
margin: 0 50px;
}
.five li:nth-child(5){
margin-left: 50px;
}
.six{
justify-content: space-around;
align-items: center;
}
</style>
</head>
<body>
<div class="main">
<ul class="one">
<li></li>
</ul>
<ul class="two">
<li></li>
<li></li>
</ul>
<ul class="three">
<li></li>
<li></li>
<li></li>
</ul>
<ul class="four">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<ul class="five">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<ul class="six">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>

</body>
</html>


屏幕快照 2017-09-11 下午7.23.00.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • H5移动端知识点总结 阅读目录 移动开发基本知识点 calc基本用法 box-sizing的理解及使用 理解dis...
    Mx勇阅读 4,833评论 0 26
  • 移动开发基本知识点 一.使用rem作为单位 html { font-size: 100px; } @media(m...
    横冲直撞666阅读 3,736评论 0 6
  • flex 布局是 css3 中使用最频繁也是最出色的功能,有点复杂,分为应用在容器上的属性和项目上的属性,即父元素...
    rayman_v阅读 964评论 1 4
  • flex 布局是 css3 中使用最频繁也是最出色的功能,有点复杂,分为应用在容器上的属性和项目上的属性,即父元素...
    LaBaby_阅读 438评论 0 0
  • 昨天我正躺在床上和朋友聊微信,隐约听见了“下雨”的声音,心里不由得一阵激动。不过瞬间我就反应了过来,现在冬天怎么可...
    hey加油王小二阅读 1,032评论 0 0

友情链接更多精彩内容