午夜勾魂曲-午夜福利自怕-午夜福利在线观看6080-午夜福利院电影-国产精品毛片AV久久97-国产精品麻豆高潮刺激A片

Flex布局-骰子demo

2018-4-20    seo達(dá)人

如果您想訂閱本博客內(nèi)容,每天自動發(fā)到您的郵箱中, 請點這里

最近學(xué)習(xí)了Flex布局,

以下是阮一峰老師關(guān)于Flex的博客  。在此感謝他讓我get一項新技能!

Flex語法篇:http://www.ruanyifeng.com/blog/2015/07/flex-grammar.html

Flex實戰(zhàn)篇:http://www.ruanyifeng.com/blog/2015/07/flex-examples.html

1、色子數(shù):1

思路:讓圓點(即子元素)在橫軸上居中在豎軸上居中,分別用justify-content和align-items

實現(xiàn)代碼:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style> *{  margin:0;  padding:0;  }  body{  background:#000;  }  .main {  width: 200px;  height: 200px;  background: #fff;  border-radius: 20px;  margin: 100px auto;  padding: 25px;  -webkit-box-sizing: border-box;  -moz-box-sizing: border-box;  box-sizing: border-box;  display: flex;  justify-content: center;  align-items:center;  }  .main >div{  width:40px;  height:40px;  background:#000;  border-radius:40px;  }  </style>
</head>
<body>
<div class="main">
    <div class="item"></div>
</div>
</body>
</html>
2、色子數(shù):2

思路:豎列布局且在主軸方向采用justify-content的兩端對齊布局,這樣兩個圓點會在左邊呈現(xiàn),然后采用align-items讓其居中

實現(xiàn)代碼:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style> *{  margin:0;  padding:0;  }  body{  background:#000;  }  .main {  width: 200px;  height: 200px;  background: #fff;  border-radius: 20px;  margin: 100px auto;  padding: 25px;  -webkit-box-sizing: border-box;  -moz-box-sizing: border-box;  box-sizing: border-box;  display: flex;  flex-direction: column;  justify-content: space-between;  align-items:center;  }  .main >div{  width:40px;  height:40px;  background:#000;  border-radius:40px;  }  </style>
</head>
<body>
<div class="main">
    <div class="item"></div>
    <div class="item"></div>
</div>
</body>
</html>
3、色子數(shù):3

思路:用到align-self屬性讓第二個和第三個圓點有自己的屬性設(shè)置,分別在縱軸方向上居中和低端對齊

實現(xiàn)代碼:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style> *{  margin:0;  padding:0;  }  body{  background:#000;  }  .main {  width: 180px;  height: 180px;  background: #fff;  border-radius: 20px;  margin: 100px auto;  padding: 25px;  -webkit-box-sizing: border-box;  -moz-box-sizing: border-box;  box-sizing: border-box;  display: flex;  }  .main >div{  width:40px;  height:40px;  background:#000;  border-radius:40px;  }  .item:nth-child(2){  align-self:center;  }  .item:nth-child(3){  align-self:flex-end;  }  </style>
</head>
<body>
<div class="main">
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
</div>
</body>
</html>
4、色子數(shù):4

思路:先豎著放兩行圓點,每行圓點里橫著放兩個圓點,所以最外層父元素設(shè)置align,里面的父元素設(shè)置justify-content

實現(xiàn)代碼:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style> *{  margin:0;  padding:0;  }  body{  background:#000;  }  .main {  width: 180px;  height: 180px;  background: #fff;  border-radius: 20px;  margin: 100px auto;  padding: 25px;  -webkit-box-sizing: border-box;  -moz-box-sizing: border-box;  box-sizing: border-box;  display: flex;  flex-wrap:wrap;  align-content:space-between;  }  .column >div{  width:40px;  height:40px;  background:#000;  border-radius:40px;  }  .column{  flex-basis:100%;  display:flex;  justify-content: space-between;  }  </style>
</head>
<body>
<div class="main">
    <div class="column">
        <div class="item"></div>
        <div class="item"></div>
    </div>
    <div class="column">
        <div class="item"></div>
        <div class="item"></div>
    </div>
</div>
</body>
</html>
5、色子數(shù):5

實現(xiàn)代碼:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style> *{  margin:0;  padding:0;  }  body{  background:#000;  }  .main {  width: 180px;  height: 180px;  background: #fff;  border-radius: 20px;  margin: 100px auto;  padding: 25px;  -webkit-box-sizing: border-box;  -moz-box-sizing: border-box;  box-sizing: border-box;  display: flex;  flex-wrap:wrap;  align-content:space-between;  }  .column > div{  width:40px;  height:40px;  background:#000;  border-radius:40px;  }  .column{  flex-basis:100%;  display:flex;  justify-content: space-between;  }  .column:nth-child(2){  justify-content: center;  }  </style>
</head>
<body>
<div class="main">
    <div class="column">
        <div class="item"></div>
        <div class="item"></div>
    </div>
    <div class="column">
    <div class="item"></div>
    </div>
    <div class="column">
        <div class="item"></div>
        <div class="item"></div>
    </div>
</div>
</body>
</html>
6、色子數(shù):6

思路:跟四點的一樣,先豎放三行在每行橫放兩個圓點

實現(xiàn)代碼:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style> *{  margin:0;  padding:0;  }  body{  background:#000;  }  .main {  width: 180px;  height: 180px;  background: #fff;  border-radius: 20px;  margin: 100px auto;  padding: 15px;  -webkit-box-sizing: border-box;  -moz-box-sizing: border-box;  box-sizing: border-box;  display: flex;  align-content:space-between;  flex-wrap:wrap;  }  .column > div{  width:40px;  height:40px;  background:#000;  border-radius:40px;  }  .column{  flex-basis:100%;  display:flex;  justify-content: space-between;  }  </style>
</head>
<body>
<div class="main">
    <div class="column">
        <div class="item"></div>
        <div class="item"></div>
    </div>
    <div class="column">
        <div class="item"></div>
        <div class="item"></div>
    </div>
    <div class="column">
        <div class="item"></div>
        <div class="item"></div>
    </div>

</div>
</body>
</html>

藍(lán)藍(lán)設(shè)計m.gerard.com.cn )是一家專注而深入的界面設(shè)計公司,為期望卓越的國內(nèi)外企業(yè)提供卓越的UI界面設(shè)計、BS界面設(shè)計 、 cs界面設(shè)計 、 ipad界面設(shè)計 、 包裝設(shè)計 、 圖標(biāo)定制 、 用戶體驗 、交互設(shè)計、 網(wǎng)站建設(shè) 平面設(shè)計服務(wù)

日歷

鏈接

個人資料

存檔

主站蜘蛛池模板: 日韩精品一卡二卡三卡四卡2021 | 动漫美女喷水 | 丝瓜影院观看免费高清国际观察 | 伊人情人网综合 | 伦理片天堂eeuss影院2o12 | 2019精品国产品在线不卡 | av女优快播 | 亚洲AV综合99一二三四区 | 乡土女性网动态图解 | 嗯啊…跟校草在教室里做h 嗯 用力啊 嗯 c我 啊哈老师 | 91精选国产 | AV无码国产精品午夜A片麻豆 | 久久国产加勒比精品无码 | 日韩中文无线码在线视频 | 国产精品久久免费视频 | 郭德纲于谦2012最新相声 | 成电影人免费网站 | 两个人在线观看的视频720 | 欧美video巨大粗暴18 | 国产精品久久久久久久A片冻果 | 国产精品亚洲AV色欲在线观看 | 精品三级在线观看 | 2017最新伦理伦理片67 | 国产人妻人伦精品59HHH | 久久er国产免费精品 | 亚洲性爱城| 爱情岛aqdlttv| 精品丰满人妻无套内射 | 亚洲免费成人 | 美女脱了内裤张开腿让男人爽 | jk制服喷水 | 精品一成人岛国片在线观看 | 乳巨揉みま痴汉电车中文字幕动漫 | 久久香蕉国产线看观看精品 | 且试天下芒果免费观看 | 在线亚洲精品福利网址导航 | 亚洲精品6久久久久中文字幕 | 欧洲电影巜肉欲丛林 | 6080yy亚洲久久无码 | 精品国产美女AV久久久久 | 亚洲精品蜜桃AV久久久 |