Skip to content

Commit 97f666d

Browse files
committed
Selectors Re-Visited - ::first-line and ::first-letter
1 parent fb03999 commit 97f666d

File tree

2 files changed

+11
-26
lines changed

2 files changed

+11
-26
lines changed

index.html

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

1313
<body>
14-
<div class="header">
15-
<h1>I'm child and descendant</h1>
16-
</div>
17-
<div class="header">
18-
<h1>I'm child and descendant</h1>
19-
<ul>
20-
<li>
21-
<h1>I'm a descendant</h1>
22-
</li>
23-
</ul>
24-
</div>
14+
<p>
15+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Mollitia hic
16+
placeat natus dolore debitis minima est, nostrum nam doloribus voluptate
17+
ducimus quo, culpa dicta numquam voluptatem delectus? Praesentium, qui
18+
ullam.
19+
</p>
2520
</body>
2621
</html>

styles.css

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
1-
/* Selectors Re-Visited - Descendant and Child Selectors */
1+
/* Selectors Re-Visited - ::first-line and ::first-letter */
22

3-
.header h1 {
4-
color: green;
3+
p::first-line {
4+
font-weight: 700;
55
}
66

7-
/* direct child */
8-
.header > h1 {
9-
color: fuchsia;
10-
}
11-
12-
div h1 {
13-
color: red;
14-
}
15-
16-
/* direct child */
17-
div > h1 {
18-
color: blue;
7+
p::first-letter {
8+
font-size: 150%;
199
}

0 commit comments

Comments
 (0)