HTML使用栅格布局实现六种筛子样式的代码详解
发布时间:2020-06-03 16:17:23 作者:南 墙 我要评论
这篇文章主要介绍了HTML使用栅格布局实现六种筛子的样式,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
先上效果图下面附上代码
<!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利用九宫格原理进行网页布局,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧2020-03-13
- 这篇文章主要介绍了吃透移动端 Html5 响应式布局,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习2019-12-16
- 本篇文章主要介绍了详解html5页面 rem 布局适配方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧2018-01-12
- 这篇文章主要介绍了HTML+CSS实现单列布局水平居中布局的相关资料,需要的朋友可以参考下2017-09-06
- 这篇文章主要为大家详细介绍了html5 div布局与table布局,区分div布局与table布局的异同,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2016-11-16
最新评论