位置:电子教程 > Flex Box实战教程 (如果看不到内容请使用360浏览器) 推荐学习资源
网页布局实战
九宫格实战
当前阅读教程:Flex Box实战教程 > 七个项目的布局
阅读(22555525)      收藏       赞(5685)      分享
上一篇: 六个项目的布局 下一篇: 八个项目的布局

效果图

小白教程网www.2d5.net

image.png

代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>七个项目的布局(1)</title>
</head>
 
<body>
<style>
.rongqi{ width:250px; height:250px; background-color:#CCC; display:flex;}
.xm{ width:70px; height:70px; background-color:#39F; margin:5px;}
</style>
<div style="flex-wrap:wrap;justify-content:space-around;">
  <div>01</div>
  <div>02</div>
  <div>03</div>
  <div>04</div>
  <div>05</div>
  <div>06</div>
  <div>07</div>
  <div>08</div>
  <div>09</div>
</div><hr>
 
<div style="flex-wrap:wrap;justify-content:flex-start;">
     <div   style="display:flex;">
      <div>01</div>
      <div>02</div>
      <div>03</div>
   </div>
     <div   style="display:flex; width:100%;">
      <div style="margin-left:auto; ">06</div>
   </div>
     <div   style="display:flex;">
      <div>07</div>
      <div>08</div>
      <div>09</div>
   </div>     
</div><hr>
 
<div style="flex-wrap:wrap;justify-content:flex-start;">
     <div   style="display:flex;">
      <div>01</div>
      <div>02</div>
      <div>03</div>
   </div>
     <div   style="display:flex; width:100%;justify-content:flex-end;">
      <div>06</div>
   </div>
     <div   style="display:flex;">
      <div>07</div>
      <div>08</div>
      <div>09</div>
   </div>     
</div><hr>
 
<div style="flex-wrap:wrap;justify-content:flex-start;">
     <div   style="display:flex;">
      <div>01</div>
      <div>02</div>
      <div>03</div>
   </div>
     <div   style="display:flex; background-color:#0C6; width:100%;">
      <div style="margin-left:auto; margin-right:auto;">05</div>
   </div>
     <div   style="display:flex;">
      <div>07</div>
      <div>08</div>
      <div>09</div>
   </div>     
</div><hr>
 
 
<div style="flex-wrap:wrap;justify-content:flex-start;">
     <div   style="display:flex;">
      <div>01</div>
      <div>02</div>
      <div>03</div>
   </div>
     <div   style="display:flex; justify-content:space-around; background-color:#0C6; width:100%;">
      <div>05</div>
   </div>
     <div   style="display:flex;">
      <div>07</div>
      <div>08</div>
      <div>09</div>
   </div>     
</div><hr>
 
<div style="flex-wrap:wrap;justify-content:flex-start;">
     <div   style="display:flex;">
      <div>01</div>
      <div>02</div>
      <div>03</div>
   </div>
     <div   style="display:flex;">
      <div>04</div>
   </div>
     <div   style="display:flex;">
      <div>07</div>
      <div>08</div>
      <div>09</div>
   </div>     
</div><hr>
 
<div style="flex-wrap:wrap;">
  <div>01</div>
  <div>02</div>
  <div>03</div>
  <div>04</div>
  <div>05</div>
  <div>06</div>
  <div style="margin-left:auto;">09</div>
</div><hr>
 
<div style="flex-wrap:wrap;justify-content:flex-end;">
  <div>01</div>
  <div>02</div>
  <div>03</div>
  <div>04</div>
  <div>05</div>
  <div>06</div>
  <div>09</div>
</div><hr>
 
<div style="flex-wrap:wrap;">
  <div>01</div>
  <div>02</div>
  <div>03</div>
  <div>04</div>
  <div>05</div>
  <div>06</div>
  <div style=" margin-left:auto; margin-right:auto;">08</div>
</div><hr>
 
<div style="flex-wrap:wrap;justify-content:space-around;">
  <div>01</div>
  <div>02</div>
  <div>03</div>
  <div>04</div>
  <div>05</div>
  <div>06</div>
  <div>08</div>
</div><hr>
 
<div style="flex-wrap:wrap;">
  <div>01</div>
  <div>02</div>
  <div>03</div>
  <div>04</div>
  <div>05</div>
  <div>06</div>
  <div>07</div>
</div><hr>
</body>
</html>



上一篇: 六个项目的布局 下一篇: 八个项目的布局
计算机毕业设计作品网      毕业设计文档网      小程序教程网       毕业设计资料网  |         毕业设计定制QQ:45157718(微信同号)(备注:毕设)