종류
width: <크기> | <백분율> | auto
height: <크기> | <백분율> | auto
속성
<html>
<head>
<style>
.box1 {
width: 400px;
height: 100px;
background: #ff6a00;
}
.box2 {
width: 50%;
height: 200px;
background: #0094ff;
}
div { margin: 10px; }
</style>
</head>
<body>
<div class="box1">
<div class="box2">
</div>
</div>
</body>
</html>
display: none | contents | block | inline | inline-block | table | table-cell 등
<html>
<head>
<meta charset="utf-8">
<style>
.inline {
width: 30px;
height: 30px;
display: inline;
background: #ff6a00;
}
.block {
width: 30px;
height: 30px;
display: block;
background: #0094ff;
}
</style>
</head>
<body>
<div class="inline">개나리</div>
<div class="inline">무궁화</div>
<div class="inline">아카시아</div>
<div class="block">개나리</div>
<div class="block">무궁화</div>
<div class="block">아카시아</div>
</body>
</html>
[CSS 기초] 여백을 조절하는 속성들 (0) | 2021.04.28 |
---|---|
[CSS 기초] 테두리 관련 속성들 (0) | 2021.04.27 |
[CSS 기초] 배경 색과 배경 이미지 (0) | 2021.04.24 |
[CSS 기초] 목록 스타일 (0) | 2021.04.23 |
[CSS 기초] 문단 스타일 (2) (0) | 2021.04.21 |
댓글 영역