DIV 칸 나누기와 정렬하기 방법 가르쳐 주세요.
그림으로 와 같이 표 나누기 하듯이 하고 싶은데 어떻게 하는지 알거ㅓ싶어여

|
답변 2개 / 댓글 1개
채택된 답변
+20 포인트
바트컨트롤
4년 전
float left를 할 것이냐
flex를 활용할 것이냐 등등 현재 만드시고 있는 마크업에 따라
진행을 하셔야 할 것 같아요
그냥 예로 전달드립니다
Copy
<style>
*{margin:0;padding:0;list-style:none}
.box_wrap1{width:400px;margin:0 auto}
.box_wrap1 div {width:50%;height:200px;float:left;background-color:#ddd;border:1px solid #000;box-sizing: border-box;}
.box_wrap1:after{clear:both;content:'';display:block}
.box_wrap2{width:400px;display:flex;flex-wrap:wrap;margin:0 auto}
.box_wrap2 div{flex-basis:50%;height:200px;background-color:#ddd;border: 1px solid #000;box-sizing: border-box;}
</style>
<div class="box_wrap1">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="box_wrap2">
<div></div>
<div></div>
<div></div>
<div></div>
</div>

답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.