成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

css3 - 如圖的flex骰子布局是怎么實(shí)現(xiàn)的?

瀏覽:164日期:2023-07-10 09:08:50

問題描述

css3 - 如圖的flex骰子布局是怎么實(shí)現(xiàn)的?看了阮一峰大神的博客是如下寫的,可是怎么都沒有效果

<p class='box'> <span class='item'></span> <span class='item'></span></p>.box { display: flex;}.item:nth-child(2) { align-self: center;}只能是如下的效果

css3 - 如圖的flex骰子布局是怎么實(shí)現(xiàn)的?

問題解答

回答1:

他的這個(gè)例子沒寫對(duì),他頁(yè)面上還有其他一些例子是錯(cuò)的

可以再增加第三個(gè) item ,背景設(shè)為透明來隱藏然后 box 設(shè)置 justify-content: space-between

回答2:

body{ background: rgb(44, 44, 44)} .box { display: flex; width: 200px; height: 200px; background: rgb(225,225,225); border-radius:10px; border:outset white 10px;}.item{ width: 30%; height: 30%; background: rgb(44, 44, 44); border-radius: 50%;}.item:nth-child(1) { margin: 5px } .item:nth-child(2) { align-self: center;}回答3:

樣式?jīng)]加,哥們

標(biāo)簽: CSS
相關(guān)文章: