-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPseudoSelectors.html
More file actions
99 lines (75 loc) · 2.28 KB
/
PseudoSelectors.html
File metadata and controls
99 lines (75 loc) · 2.28 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
99
<!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>
.container{
display: block;
width: 233px;
margin: auto;
}
input{
display: block;
}
input[type='text']{
padding: 23px;
border: 2px solid red;
}
a[target]{
font-size: 44px;
color: violet;
}
a[target='_self']{
font-size: 40px;
color: rgb(79, 105, 188);
}
input[type='email']{
color: yellow;
border: 4px solid black;
}
/* This will apply CSS fr third child of li tag */
/* li:nth-child(3){
color: cyan;
}
li:nth-child(2n+0){
color: red;
} */
li:nth-child(3n+1){ /*starts the formula from n=0, add and multiply something to alter it accordingly. */
color: red;
}
/* Odd child */
/* li:nth-child(odd){
background-color: yellow;
} */
li:nth-child(even){
background-color: yellow;
}
</style>
</head>
<body>
<div class="container">
<h1><a href="http://google.com" target="_blank">Go to google</a></h1>
<h1><a href="http://facebook.com" target="_self">Go to facebook</a></h1>
<form action="" class="form-control">
<input type="text" placeholder="Enter your Name">
<input type="password" placeholder="Enter your Password">
<input type="email" placeholder="Enter your Email">
<input type="submit" placeholder="Submit">
</form>
<ul>
<li class="item" id="item1">Item1</li>
<li class="item" id="item2">Item2</li>
<li class="item" id="item3">Item3</li>
<li class="item" id="item4">Item4</li>
<li class="item" id="item5">Item5</li>
<li class="item" id="item6">Item6</li>
<li class="item" id="item7">Item7</li>
<li class="item" id="item8">Item8</li>
<li class="item" id="item9">Item9</li>
<li class="item" id="item10">Item10</li>
</ul>
</div>
</body>
</html>