我有一個父div
與display: flex
。我想爲其中一個孩子div
忽略這一點。如何讓div忽略它的父級顯示:flex
例如,我想是這樣的:
兒童DIV1
兒童DIV2,兒童DIV3,兒童DIV4
我想第一個孩子DIV1是在上面,而無需任何其他元素它是線。我知道我可以做到這一點,如果我只是把孩子div1帶到父母的外面,但是知道另一種方式是很好的。
/* Parent div */
.boxContainer {
display: flex;
height: 500px;
width: 100%;
}
/* Child div1 */
.headerBox {
height: 100px;
}
/* more child div */
.imgBox {
margin-top: 100px;
height: 375px;
width: 375px;
}
這確實是最好的移動頭部的容器外完成。特別是在頭部的情況下。 – Don