html - 将 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;
}
解决方案
使用对齐项目:弹性开始;在 .schedule-content 上
推荐阅读
- jquery - jquery asp.net 日期选择器
- python - 比较列表并修改特定值
- c - 如何将指向结构的指针传递给在不同标头中描述的函数?
- c++ - 为什么当我尝试对数字加矩阵求和时,运算符重载失败?(但它的工作方式相反)
- python - tensorly.kruskal_to_tensor() 方法解释
- angular - Angular - 使用 Pairwise 运算符测试 Observable
- libvlc - 禁用登录 libvlc api
- python - PySide:除了它发送的 exitCode 之外,我如何将其他参数传递给连接到 QProcess 完成信号的插槽?
- excel - Excel 2016 32 位宏在 Excel 2016 64 位上引发宏错误 - 已尝试 PtrSafe(以下两个代码)
- python - BertForSequenceClassification 是否在 CLS 向量上进行分类?