240104 웹 만들기 ; position.html

2024. 1. 4. 19:582023.11.21-2024.05.31

 

(자바스크립트+CSS+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
<!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>
        .box1,.box2{
            width: 100px;
            height: 100px;
            border: 1px solid black;
        }
        .box1{
            left: calc(50%-50px);
            top: 20px;
            position: relative;
            z-index: -1;
            background-color: pink
 
        }
        .box2{
            position: relative; /* 겹치기 용도, 먼저 쓰고 아래 z-index 써야한다 */
            z-index: 1/* 우선순위, 낮은 수부터 먼저 해 */
            margin:-50px 0px 0px 0px;
            background-color: purple;
 
        }
 
 
 
    </style>
</head>
<body>
    <div class="box1">
 
    </div>
    <div class="box2">
 
    </div>
 
    <a href="./write.html">글쓰기</a>
 
    
</body>
</html>
cs

'2023.11.21-2024.05.31' 카테고리의 다른 글

240106 복습 게시판 만들기(INDEX)  (1) 2024.01.06
240104 웹 만들기 ; write.html  (1) 2024.01.04
240104 웹 만들기 ; menu.html  (1) 2024.01.04
240104 웹 만들기 ; div.html  (1) 2024.01.04
240104 웹 만들기 ; main.html  (1) 2024.01.04