-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP7.html
More file actions
50 lines (49 loc) · 1.21 KB
/
P7.html
File metadata and controls
50 lines (49 loc) · 1.21 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NavBar</title>
<style>
*{
margin: 0;
padding: 0;
}
html, body{
width: 100%;
height:100%;
}
nav{
display: flex;
background: rgb(171, 91, 103);
height:25px;
}
nav li{
list-style: none;
padding: 0 23px;
}
</style>
</head>
<body>
<nav>
<li>Home</li>
<li>About</li>
<li>Advertisment</li>
<li>Contact</li>
</nav>
<table>
<td>Hello</td>
<tr>Hello 1</tr>
<tr>Hello 2</tr>
<tr>Hello 3</tr>
<tr>Hello 4</tr>
</table>
<script>
document.getElementsByTagName("nav")[0].firstElementChild.style.color = "orange"
document.getElementsByTagName("nav")[0].lastElementChild.style.color = "red"
Array.from(document.getElementsByTagName("li")).forEach((element) => {
element.style.background = "yellow"
})
</script>
</body>
</html>