首页 > 解决方案 > 将 Div 与 td 内的顶部对齐

问题描述

我希望在头部下方对齐 div。我似乎无法让它工作。(见代码和照片)。

我的HTML:

          <td>
            <div class="schedule-content">
              <div class="timestamp">
                <h3>00:00 - 00:00</h3>
                <ul>
                  <li>Name1</li>
                  <li>Name2</li>
                  <li>Name3</li>
                </ul>
              </div>
            </div>
          </td>

我的CSS:

#schedule .schedule td .schedule-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#schedule .schedule td .timestamp {
  background-color: #fff;
  height: auto;
  width: 95%;
  border-radius: 10px;
  padding: 0.5rem;
  margin: 0.4rem 0;
}

问题

标签: htmlcss

解决方案


使用对齐项目:弹性开始;在 .schedule-content 上


推荐阅读