CSS height 속성은 요소의 높이를 지정하는 데 도움이 됩니다.
구문
CSS 높이 속성의 구문은 다음과 같습니다 -
Selector {
height: /*value*/
} 예시
다음 예는 CSS 높이 속성을 보여줍니다.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<style>
html, body {
margin: 0px;
height: 100vh;
}
div {
height: 100%;
text-align: center;
background: mistyrose;
}
</style>
</head>
<body>
<div>100% height!!</div>
</body>
</html> 예시
이것은 다음과 같은 출력을 제공합니다.

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<style>
html, body {
display: flex;
flex-direction: row;
justify-content: space-around;
margin: 0px;
height: 100vh;
box-shadow: inset 0 0 40px lightblue;
}
div {
width: 40%;
height: 100vh;
text-align: center;
box-shadow: inset 0 0 20px lightcoral;
}
</style>
</head>
<body>
<div>Watch This!</div>
<div>Let Me Show You How The Boss Does It!!</div>
<div>Open Up The Sky!!</div>
<div>GO! GO! GO!!</div>
</body>
</html> 이것은 다음과 같은 출력을 제공합니다.
