我正在try 让一行元素均匀分布,最左边和最右边的元素与它们各自的边缘对齐.这张图片显示了我目前所拥有的关于错误的注释:
.header-section {
border: 1px solid red;
display: flex;
width: fit-content;
height: fit-content;
flex-direction: column;
}
.title {
font-size: 75pt;
margin: 0;
}
.subtitles {
display: flex;
justify-content: space-between;
width: 100%;
}
.subtitles label {
flex-grow: 1;
text-align: center;
width: fit-content;
}
<div class="header-section">
<h1 class="title">Title goes here</h1>
<div class="subtitles">
<label><- this should be left</label>
<label>This is fine</label>
<label>this should be right -></label>
</div>
</div>
(边框仅用于调试)
我怎么才能解决这个问题呢?我假设它是带有JUSTY-CONTENT选项的东西.谢谢!