我有 10 个 div:2 个隐藏的和 8 个堆叠在一起的。
使用媒体查询,在调整屏幕大小时,我可以显示 2 个隐藏的 div。
所以,现在我在底部有 4 个红色 div,但我希望它们成对出现 - 2 行,2 个红色 div,一个挨着一个。
我怎么做?
html {
font-size: 20px;
}
.box {
color: white;
font-size: 100px;
text-align: center;
text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
padding: 10px;
Margin: 5px;
/* width: calc(33.33% - 10px);*/
}
/* Flexbox code starts here */
.container {
display: flex;
/*Must!!!! on the container, in order to turn it to flex*/
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
} …
Run Code Online (Sandbox Code Playgroud)