如何使div从底部到顶部而不是从顶部到底部。例如,此代码将div从顶部到底部放置。
But how to make the divs are located from bottom to top as in this picture
<!DOCTYPE html>
<body>
<div class="message">
<div class="message__block">4</div>
<div class="message__block">3</div>
<div class="message__block">2</div>
<div class="message__block">1</div>
</div>
</body>
</div>
<style>
.message {
width: 100vmin;
height: 100vmin;
overflow: hidden;
background: green;
}
.message__block {
color: white;
width: 100%;
height: 9vmin;
background: black;
margin-bottom: 1.1vmin;
}
</style>
</body>
</html>
But how to make the divs are located from bottom to top as in this picture
flex-direction: column-reverse;
来实现相同的效果。 - Jakub A Suplickiflex-shrink
的信息:https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink,您可以看到它与`flex-basis`结合使用。 - Jakub A Suplicki