-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdom.html
89 lines (70 loc) · 2.09 KB
/
dom.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grids In Css</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
width: 100vw;
height: 100vh;
background-color: aqua;
padding: 20px;
display: grid;
row-gap: 1rem;
column-gap: 1rem;
}
.itms {
border: 2px solid black;
background-color: rgb(166, 239, 239);
display: flex;
justify-content: center;
align-items: center;
font-size: 2.2em;
}
@media (min-width:821px) {
.container{
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(4, 1fr);
}
.Header,
.Footer {
grid-column-start: 1;
grid-column-end: 4;
}
.SideBar {
grid-row-start: 2;
grid-row-end: 4;
}
.Content1 {
grid-column-start: 2;
grid-column-end: 4;
}
}
</style>
</head>
<body>
<div class="container">
<div class="itms boxx Header" id="box1">Header</div>
<div class="itms boxx SideBar" id="box2">SideBar</div>
<div class="itms boxx Content1 " id="box3">Content1</div>
<div class="itms boxx Content2" id="box4">Content2</div>
<div class="itms boxx Content3" id="box5">Content3</div>
<div class="itms boxx Footer" id="box6">Footer</div>
</div>
<script>
let box=document.getElementsByClassName('itms')
console.log(box)
console.log(box[2].innerHTML="ganesh")
console.log(box[5].innerHTML="ghode")
box[1].setAttribute('id',"ganesh")
let nn= document.getElementById('ganesh').setAttribute("id","ganesh 1")
console.log(nn)
</script>
</body>
</html>