首页 > 解决方案 > 如何对齐项目中的项目

问题描述

我想要一个宽度为 100% 并且将其项目向右对齐的细节。

我试过了:

details {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

HTML:

<details>
  <summary>example</summary>

  <div>aaa</div>
  <div>aaa</div>
  <div>aaa</div>
  <div>aaa</div>
</details>

问题是,这些项目是 100% 宽的,并且没有向右对齐。

标签: htmlcss

解决方案


尝试使用justify-content:space-between而不是align-item:flex-end


推荐阅读