프런트엔드-CSS

CSS 스타일링

강사: 최퍼블리셔 · 작성자: 이종춘 · 작성일: 2026-05-13 11:40:16 · 조회수: 8

스타일 시트 after, before 설명
목록으로
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin:0;
padding:0;
box-sizing:border-box;
}

.box{
width: 300px;
height: 700px;
background-color: aquamarine;
}

.box::before{
content: "";
width: 100%;
height: 100px;
background-color: rgb(182, 166, 26);
display: block;
}

.box::after{
content: "";
width: 100%;
height: 100px;
background-color: rgb(15, 73, 51);
display: block;
}



</style>
</head>

<body>

<div class="box"></div>

</div>
</body>
</html>
#스타일 시트 after #before

첨부 파일

0개
첨부된 파일이 없습니다.

댓글 / 답글

0개
댓글을 작성하려면 로그인하세요.
아직 댓글이 없습니다.