css3 flex弹性盒子布局简单使用
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link rel="stylesheet" href="./csses/mycss.css"> </head> <body> <!-- <div class="mydiv">wwwwqqq</div> --> <div class="flexcontent"> <div class="flexitem">1justify-content: center</div> <div class="flexitem">2justify-content: center</div> <div class="flexitem">3justify-content: center</div> <div class="flexitem">4justify-content: center</div> </div> <div class="flexcontent2"> <div class="flexitem2">1justify-content: space-between</div> <div class="flexitem2">2justify-content: space-between</div> <div class="flexitem2">3justify-content: space-between</div> <div class="flexitem2">4justify-content: space-between</div> </div> <div class="flexcontent3"> <div class="flexitem3">1justify-content: space-around</div> <div class="flexitem3">2justify-content: space-around</div> <div class="flexitem3">3justify-content: space-around</div> <div class="flexitem3">4justify-content: space-around</div> </div> <div class="flexcontent4"> <div class="flexitem4">1justify-content: space-evenly</div> <div class="flexitem4">2justify-content: space-evenly</div> <div class="flexitem4">3justify-content: space-evenly</div> <div class="flexitem4">4justify-content: space-evenly</div> </div> </body> </html>
.flexcontent{ margin-top: 10px; display: flex; width: 1000px; height: 120px; border: 1px solid rebeccapurple; justify-content: center; /* direction: rtl; */ /* direction:ltr; rtl; 排列開始從左到右還是從右到左側*/ } .flexcontent2{ margin-top: 10px; display: flex; width: 1000px; height: 120px; border: 1px solid rgb(44, 143, 46); justify-content:space-between } .flexcontent3{ margin-top: 10px; display: flex; width: 1000px; height: 120px; border: 1px solid rgb(143, 84, 44); justify-content:space-around } .flexcontent4{ margin-top: 10px; display: flex; width: 1000px; height: 120px; border: 1px solid rgb(75, 44, 143); justify-content:space-evenly } .flexitem{ width: 120px; height: 80px; border: 1px solid rgb(127, 153, 51); margin: 10px; background-color: bisque; text-align: center; } .flexitem2{ width: 120px; height: 80px; border: 1px solid rgb(127, 153, 51); margin: 10px; background-color: rgb(167, 165, 162); text-align: center; } .flexitem3{ width: 120px; height: 80px; border: 1px solid rgb(127, 153, 51); margin: 10px; background-color: rgb(121, 139, 120); text-align: center; } .flexitem4{ width: 120px; height: 80px; border: 1px solid rgb(127, 153, 51); margin: 10px; background-color: rgb(102, 189, 150); text-align: center; }
如有疑问或者错误的地方,请跟帖,本人会第一时间答复以及相互学习,谢谢!个人会不断的上传自己的学习心得!
好了今天就先到这里,下次有时间再更新,如果存在不合理的地方,欢迎大家多多指教留言!!!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
2019-11-01 封装自己通用的 增删改查的方法 By EF
2019-11-01 怎么在.Net Core3.0/ 3.1Webapi 中使用Log4net 写日志 及读取配置文件的信息