-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.css
69 lines (57 loc) · 1.26 KB
/
index.css
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
/* General Styles */
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
padding: 20px;
}
h1, h2 {
color: #333;
}
section {
border: 1px solid #ddd;
padding: 15px;
margin-bottom: 20px;
background-color: #fff;
}
/* 1. Descendant Selector (styles all list items within the div "tree") */
.tree ul li {
color: green;
font-weight: bold;
}
/* 2. Child Selector (styles only direct children of "complex") */
.complex > p {
color: blue;
font-weight: bold;
}
/* 3. General Sibling Selector (styles all siblings of the h3 in "neighborhood") */
.neighborhood h3 ~ p {
color: purple;
font-style: italic;
}
/* 4. Adjacent Sibling Selector (styles the paragraph directly after h3) */
.alleyway h3 + p {
color: orange;
font-weight: bold;
}
/* 5. Pseudo Classes */
.playground a:hover {
color: red;
text-decoration: underline;
}
.playground button:active {
background-color: #333;
color: white;
}
/* 6. Pseudo Elements */
.newspaper p::first-line {
font-weight: bold;
color: darkblue;
}
.newspaper p::first-letter {
font-size: 2em;
color: darkred;
}
/* Extras */
a:visited {
color: darkgray;
}