html - flexbox:对齐自我和对齐项目不工作
问题描述
<td>
<div class="paper" style="display:flex; ">
<div class="row" style="height: 20px; background-color: "></div>
</div>
</td>
在.paper, justify
内容中工作正常,但align-items
不会工作。在其子类中.row, align-self
不起作用的地方。在此之前,<td>
我也设置了一个 flex 属性。代码如下所示:
<td>
<div class="wrapper" style="display: flex;">
<div class="close" style="align-self: center;">
<i class="icon fa fa-times"></i>
</div>
<div class="image ml-15">
<img class="width-100" src="commercial/front-end/shop/lauren-winter-studio-top-natural_0190-cropped.jpg" alt="">
</div>
<div class="details pull-right ml-20" style="align-self: center;">
<span>Cream Top</span>
</div>
</div>
</td>
<td>
<div class="paper" style="display:flex; ">
<div class="row" style="height: 20px; background-color: "></div>
</div>
</td>
解决方案
使用 align-self/align-item 时,请确保已将宽度或高度设置在父元素的正确方向。
推荐阅读
- swiftui - SheetView 中 SwiftUI .constant(nil) 绑定的意外行为
- python - 项目euler的ex 94的Python解决方案
- android - Android recyclerView 和数据绑定
- python - 如何创建特定的上三角矩阵?
- c# - EF 6 Code First 中的更新数据库错误
- apache - 代理 Apache2 之后的重定向
- python - 是否有像 Scala 那样的 Pythonic 隐含规定?即用于 FLOP 计数
- python-3.x - 对于这个问题,我可以得到一个概括的方法吗?
- python - 根据python中的字符列表生成字符串变体
- java - 如何在 persistence.xml 文件中设置动态值