매일코딩/HTML&CSS3
5.레이아웃 - 박스너비 고정하기
인생여희
2016. 11. 2. 10:58
반응형
박스너비 고정하기
1 2 3 4 5 6 7 8 9 | .box2 {float: left; width: 300px ; height: 200px; border:4px dotted green; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; text-align: center; } | cs |
1. 박스2의 너비를 300px으로 준다.
1 2 3 4 5 6 7 8 9 10 11 | .box3 {float: none; width: auto; height: 200px; border:4px dotted blue; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; text-align: center; margin-left:300px } | cs |
2. 박스 3의 float 을 none으로 하고 width 를 auto 로 한다.
그리고 박스 3의 margin-left 속성을 300px으로 줘 왼쪽공백을 만들어 준다.
반응형