background-repeat 배경이미지 반복여부 설정



background-image: url(경로) 배경이미지 파일경로 지정


background-repeat: 반복여부

repeat 반복

no-repeat 반복안함

repeat-x 가로방향 반복

repeat-y 세로방향 반복



html)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" 
          content="width=device-width, height=device-height, 
                     minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0">
    <title>Insert title here</title>
    <style>
    div {
        height: 130px;
        border: 1px solid #000;
        margin-bottom: 5px;
    }
    
    /*
    background-image: url(경로) 배경이미지 파일경로 지정
    background-repeat: 반복여부
    repeat 반복
    no-repeat 반복안함
    repeat-x 가로방향 반복
    repeat-y 세로방향 반복
    */
    .repeat {
        background-image: url(images/tile.png);
        background-repeat: repeat;
    }
    .no-repeat {
        background-image: url(images/tile.png);
        background-repeat: no-repeat;
    }
    .repeat-x {
        background-image: url(images/tile.png);
        background-repeat: repeat-x;
    }
    .repeat-y {
        background-image: url(images/tile.png);
        background-repeat: repeat-y;
    }
    </style>
</head>
 
<body>
    <div class="repeat"></div>
    <div class="no-repeat"></div>
    <div class="repeat-x"></div>
    <div class="repeat-y"></div>
</body>
</html>
cs



결과

+ Recent posts