나는 flexboxes로 조금 놀았으며 열과 행 컨테이너를 결합하려고했습니다. 내가 가진 질문은 다음과 같습니다.CSS : Flexbox 내의 Flexbox
열에 배치 된 행 요소가 플렉스 컨테이너의 전체 너비에 미치지 않는 이유는 무엇입니까?
예제 코드는 여기에 표시됩니다 : js-fiddle
HTML : 어떤 도움
/* CSS: */
.flex-container {
color: blue;
background-color:yellow;
text-decoration: bold;
text-size: 1em;
display: flex;
justify-content:space-between;
align-items:center;
}
.horizontal {
flex-direction:row;
background-color: red;
}
.vertical {
flex-direction:column;
}
<body>
<div class="flex-container vertical">
<div class=flex-item>1 </div>
<div class=flex-item>2 </div>
<div class="flex-container horizontal" >
<div class=flex-item>3a </div>
<div class=flex-item>3b </div>
<div class=flex-item>3c </div>
</div>
<div class=flex-item>4 </div>
<div class=flex-item>5 </div>
</div>
</body>
감사합니다!
당신의'.horizontal' 컨테이너가없는 충분히 넓은이기 때문입니다. '너비 : 100 %; '를 추가하십시오. – Roberrrt
글쎄 그게 꽤 간단했다;) 나는 그걸 시도했다고 생각했는데 .. –
안녕하세요, 미안 해요. 커피가 아직 쫓겨나지 않았다. 나는 또한 너비가 자동으로 제한되지 않는 이유를 실제로 알지 못하므로 솔루션을 찾을 때까지 주석으로 게시합니다. – Roberrrt