我希望flex-wrap容器中的最后一项不要换行,即保持在倒数第二项的旁边。有没有办法做到这一点?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title></title>
<style>
div.container {
display: flex;
flex-wrap: wrap;
}
div.child {
margin-right: 0.25em;
}
</style>
</head>
<body>
<h1></h1>
<div class="container">
<div class="child">Lorem</div>
<div class="child">ipsum</div>
<div class="child">dolor</div>
<div class="child">sit</div>
<div class="child">amet,</div>
<div class="child">consectetuer</div>
<div class="child">adipiscing</div>
<div class="child">elit.</div>
<div class="child">This stay next to 'elit.'</div>
</div>
</body>
</html>