-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSelectors(2).html
48 lines (45 loc) · 1.44 KB
/
Selectors(2).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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>More on Selectors</title>
<style>
h1{
background-color: peachpuff;
color:black;
font-weight: bold;
text-align: center;
}
div p{ /* For all <p> in inside <div> either directly or indirectly */
color: cornflowerblue;
font-weight: bold;
}
div > p{ /*For <p> in <din> only directly*/
color: rgb(243, 85, 64);
background-color: cadetblue;
font-weight: bold;
}
div + p{ /*For the <p> whose sibling is <div> ie.> both <p> and <div> are in sme parent container*/
color:black;
background-color: gold;
font-weight:;
}
</style>
</head>
<body>
<h1>This is more on selctors</h1>
<div class="container">
<div class="row">
<ul>
<li class="item"><p>This is another paragraph inside li</p></li>
<li>This will not get affected</li>
</ul>
<p>This is a paragraph</p>
</div>
<p>This is another paragraph</p>
</div>
<p>This is the outermost paragraph</p>
</body>
</html>