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. 一个走错路的23岁傻小子的提问2. angular.js - angularjs 使用鼠标悬停时,标签一直闪3. c++ - win764位环境下,我用GCC为什么指针占8个字节,而long是4个字节?4. html5 - HTML代码中的文字乱码是怎么回事?5. java - 安卓电视盒子取得了root权限但是不能安装第三方应用,请问该怎么办?6. javascript - SuperSlide.js火狐不兼容怎么回事呢7. android - 安卓activity无法填充屏幕8. python 计算两个时间相差的分钟数,超过一天时计算不对9. python - django 里自定义的 login 方法,如何使用 login_required()10. node.js - 函数getByName()中如何使得co执行完后才return
