【发布时间】:2021-02-23 03:31:44
【问题描述】:
如何对齐折叠项目中的内容? 顶部的标题和“其余”内容居中?
jsFiddle:https://jsfiddle.net/1wc5kv0d/4/
.row {
display: flex;
}
.col {
margin-left: 20px;
border: 1px solid black;
}
.fixed-width-height {
width: 40px;
height: 40px;
display: inline-block;
background-color: blue;
vertical-align: middle;
}
.inline-wrapper>span {
vertical-align: middle;
}
h3 {
font-size: 1rem;
}
<div class="row">
<div class="col">
<h3>
title
</h3>
<div class="should-center">
<span>Lorem Ispum</span>
<span>Icon</span>
</div>
</div>
<div class="col">
<h3>
another title
</h3>
<div class="should-center">
<div class="inline-wrapper">
<div class="fixed-width-height">
<span>Name</span>
</div>
</div>
</div>
</div>
</div>
如何实现标题(h3)保持在顶部和下面的内容应该同样居中。 (Lorem Ipsum 应与“名称”处于同一高度)
应该是(忘记那个黑色的笔触,photoshop 挣扎):
【问题讨论】:
-
您能添加一个视觉所需的输出吗?
-
是的。在上面添加。