piadream

가운데 정렬. 가장 심플?(정리)

<style>

body {margin-left:0px;margin-top:0px; width:100%;height:auto;display:inline-block;overflow:auto;} /

  .total_case {width: 100%;}

    .box_case {width: 50%;margin: 0 auto;} 

</style>

 

<div class=total_case>가 전체 body가 되고.

<div class=box_case>abcdefg123456748</div>

</div>

.box_case의 width따라서 사이즈 조절

 

|

댓글 1개

참고로 margin: 0 auto; 을 풀어서 쓰면 margin-left: auto; margin-right: auto; 로 작성해도 됩니다.

 

아래로 정렬하시려면 margin-top: auto; 를 사용할 수 있습니다

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기
🐛 버그신고