css3 - 如图的flex骰子布局是怎么实现的?
问题描述
看了阮一峰大神的博客是如下写的,可是怎么都没有效果
<p class='box'> <span class='item'></span> <span class='item'></span></p>.box { display: flex;}.item:nth-child(2) { align-self: center;}只能是如下的效果
问题解答
回答1:他的这个例子没写对,他页面上还有其他一些例子是错的
可以再增加第三个 item ,背景设为透明来隐藏然后 box 设置 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:
样式没加,哥们
相关文章:
1. nignx - docker内nginx 80端口被占用2. docker绑定了nginx端口 外部访问不到3. docker网络端口映射,没有方便点的操作方法么?4. javascript - canvas 裁剪空白区域5. docker不显示端口映射呢?6. angular.js - angular内容过长展开收起效果7. docker - 各位电脑上有多少个容器啊?容器一多,自己都搞混了,咋办呢?8. javascript - nodejs调用qiniu的第三方资源抓取,返回401 bad token,为什么9. dockerfile - 我用docker build的时候出现下边问题 麻烦帮我看一下10. debian - docker依赖的aufs-tools源码哪里可以找到啊?
