Skip to content

浮动练习

约 308 字大约 1 分钟

CSS基础版式布局

2025-06-23

拓展

学习完flex布局后,可改写为下面代码

CSS
div,ul,li{
    margin:0;
    padding:0;
  	box-sizing:border-box;
}

li {
    list-style-type: none;
}

.mi {
  	float: left; // [!code --]
  	display: flex;// [!code ++]
    justify-content: space-between;// [!code ++]
    width: 1226px;
    height: 614px;
    margin: 100px auto;
}

.left{
    float: left; // [!code --]
    width: 234px;
    height: 614px;
    background-color: skyblue;
}

.right{
    float: right; // [!code --]
    width: 978px;
    height: 614px;
    background-color: red;
}

.right ul {
  display: flex;
  flex-wrap:wrap;
  justify-content: space-between;
}

.right li{
    float: left; // [!code --]
    width: 234px;
    height: 300px;
    background-color: pink;
  	margin-right: 14px; // [!code --]
    margin-bottom: 14px;
}

更新日志

2025/6/26 22:42
查看所有更新日志
  • f7245-docs(CSS): 📝 完成CSS基础教程
  • 38633-feat(theme): ✨ 启用博客功能