-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut12.htm
More file actions
98 lines (76 loc) · 2.3 KB
/
tut12.htm
File metadata and controls
98 lines (76 loc) · 2.3 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
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
90
91
92
93
94
95
96
97
98
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Attribute and nth child pseudo selectors</title>
<style>
* {
font-size: 25px;
}
.container {
display: block;
width: 233px;
margin: auto;
}
input {
display: block;
}
input[type="text"] {
background-color: red;
}
a[target="_blank"] {
font-size: 44px;
color: saddlebrown;
}
a[target="_self"] {
color: seagreen;
}
input[type="email"] {
background-color: skyblue;
}
/* This will apply css for third chil of li */
/* li:nth-child(3){
color: rgb(0, 128, 28);
background-color: orange;
}
It starts from n=0 and moves so on
li:nth-child(2n+0){
color: rgb(241, 84, 11);
} */
/* li:nth-child(3n+3){
color: rgb(241, 11, 172);
background-color: orangered;
} */
li:nth-child(odd) {
background-color: palegoldenrod;
}
li:nth-child(even) {
background-color: rgb(223, 17, 17);
}
</style>
</head>
<body>
<div class="container">
<h1><a href="https://google.com" target="_blank">Go to google</a></h1>
<h1><a href="https://facebook.com" target="_self">Go to Facebook</a></h1>
<form action="" class="formcontrol">
<input type="text" placeholder="Enter your name">
<input type="password" placeholder="Enter your password">
<input type="email" name="" id="" placeholder="Enter your email">
<input type="submit" value="Submit">
</form>
<ul>
<li class="item" id="item-1"> Item1</li>
<li class="item" id="item-2"> Item2</li>
<li class="item" id="item-3"> Item3</li>
<li class="item" id="item-4"> Item4</li>
<li class="item" id="item-5"> Item5</li>
<li class="item" id="item-6"> Item6</li>
<li class="item" id="item-7"> Item7</li>
<li class="item" id="item-8"> Item8</li>
<li class="item" id="item-9"> Item9</li>
</ul>
</div>
</body>
</html>