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. python 中的类变量2. 老师的这种访问方式为什么我这里打不开呢3. matlab - Python能否在保存程序变量情况下启动控制台4. python - Scrapy存在内存泄漏的问题。5. 谷歌访问助手安装不了6. python - django 按日归档统计订单求解7. mysql - python开发web service 中数据库链接和释放应该怎么处理?8. python - matplotlib pie怎么设置alpha9. 网页爬虫 - 用Python3的requests库模拟登陆Bilibili总是提示验证码错误怎么办?10. 网页爬虫 - Python爬虫入门知识

网公网安备