CSS(7)

박찬영·2024년 1월 8일
0

CSS

목록 보기
7/27

1. Background

배경(background)은 콘텐츠의 배경을 정의한다.
단축 속성으로써 색상, 이미지, 반복 등 다양한 하위 속성을 정의할 수 있다.

2. 실습

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>HTML 문서</title>
        <style>
            div{
                box-sizing: border-box;
                width:500px; height:500px;
                border: 1px solid red;
                /* background-color: red; */
                background-image: url(./images/study.jpeg);
                background-repeat: no-repeat;
                background-position: center;
                background-size: contain;
                /* background : no-repeat url(./images/study.jpeg); 이렇게도 가능 */
            }
        </style>
    </head>
    <body>
        <div> 율무</div>
    </body>
</html>

profile
Back-End Developer

0개의 댓글