我想要一個菜單,其中包含內容並且內容與其他菜單項對齊。如何對齊不同父母的div?
目前我有:
[- someth something else]
[- something something else something]
[- some something else some]
而且我希望它對準這樣的:
[- someth something else ]
[- something something else something]
[- some something else some ]
這裏是什麼,我現在有代碼,但我會怎麼做它的方式我想要?
.menu {
width: 100%;
}
.menu-item {
display: flex;
justify-content: space-between;
align-items: center;
}
.wrapper2 {
display: flex;
}
<div class="menu">
<div class="menu-item">
<div class="wrapper1">Someth</div>
<div class="wrapper2">
<p>something else</p>
<p></p>
</div>
</div>
<div class="menu-item">
<div class="wrapper1">Something</div>
<div class="wrapper2">
<p>something else</p>
<p>something</p>
</div>
</div>
<div class="menu-item">
<div class="wrapper1">Some</div>
<div class="wrapper2">
<p>something else</p>
<p>some</p>
</div>
</div>
</div>
它可以用純粹的CSS來完成,看我的答案@Wiliam –