我有display:flex3列的行,并且flex-wrap已启用。列之间是手柄divs。包好柱子后,手柄div应当消失。如何使用wrap-state作为CSS选择器来定义弹性项目被包装的情况下的属性?
section {
display: flex;
flex-wrap: wrap;
background-color: lightgray;
}
section * {
margin: 1ex;
background-color: white;
}
section * ~ * {
margin-left: 0;
}
.handle {
width: 1ex;
background-color: gray;
}
aside, article {
flex: 1;
min-width: 5em;
}
#wide {
width: 30em;
}
#narrow {
width: 10em;
}Run Code Online (Sandbox Code Playgroud)
<section id="wide">
<aside>
left
</aside>
<div class="left handle"></div>
<article>
middle
</article>
<div class="right handle"></div>
<aside>
right
</aside>
</section>
<hr>
<section id="narrow"> …Run Code Online (Sandbox Code Playgroud)