Skip to content

Commit d40a82f

Browse files
committed
Selectors Re-Visited - Link pseudo-class Selectors
1 parent 3343182 commit d40a82f

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

index.html

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,10 @@
1111
</head>
1212

1313
<body>
14-
<div>
15-
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Iure hic ea
16-
voluptates corrupti nisi repellendus mollitia corporis vel iusto ducimus.
17-
</div>
18-
<div class="header">
19-
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Unde soluta
20-
temporibus asperiores ut doloribus tempore deleniti, inventore ab labore
21-
blanditiis.
22-
</div>
23-
<a href="#">i'm a simple link</a>
14+
<a href="#">general link</a>
15+
<a href="https://www.css3.com/">visited link</a>
16+
<a href="#">hover link</a>
17+
<a href="#">active link</a>
18+
<a>simple link</a>
2419
</body>
2520
</html>

styles.css

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
1-
/* Selectors Re-Visited - :hover pseudo-class Selector */
1+
/*
2+
:link - unvisited links with href
3+
:visited - visited links
4+
:hover - hover
5+
:active - as the user click's
6+
a - all links
7+
*/
8+
a {
9+
display: block;
10+
background: yellow;
11+
margin-bottom: 0.5rem;
12+
padding: 0.5rem;
13+
}
214

3-
div:hover {
4-
color: green;
15+
a:link {
16+
color: aqua;
517
}
618

7-
.header:hover {
8-
color: white;
9-
background: blue;
10-
letter-spacing: 5px;
19+
a:visited {
20+
color: red;
1121
}
1222

1323
a:hover {
14-
text-decoration: none;
15-
font-size: 20px;
16-
background: fuchsia;
24+
color: green;
25+
}
26+
27+
a:active {
28+
color: fuchsia;
1729
}

0 commit comments

Comments
 (0)