This repository was archived by the owner on May 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchild_combinator.html
More file actions
80 lines (71 loc) Β· 2.26 KB
/
Copy pathchild_combinator.html
File metadata and controls
80 lines (71 loc) Β· 2.26 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
<!DOCTYPE html>
<html>
<head>
<title>Child Combinator Examples</title>
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
<style>
/* Add some basic styling for clarity */
body {
font-family: Arial, sans-serif;
padding: 20px;
background-color: #f9f9f9;
color: #333;
}
h1 {
font-size: 28px;
margin-bottom: 20px;
}
p {
font-size: 18px;
margin-bottom: 10px;
}
.example {
margin-bottom: 40px;
border: 1px solid #ccc;
padding: 20px;
background-color: #fff;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.example-title {
font-weight: bold;
font-size: 24px;
margin-bottom: 10px;
}
.example-description {
margin-top: 5px;
}
code {
display: inline-block;
background-color: #000000;
padding: 2px 4px;
font-family: Consolas, monospace;
font-size: 16px;
color: aliceblue;
}
</style>
</head>
<body>
<h1>Child Combinator Examples</h1>
<div class="example">
<h2 class="example-title">Example 1: Selecting direct child elements</h2>
<p class="example-description">This example selects and applies styles to all <code>p</code> elements that are direct children of the <code>div</code> element.</p>
<div>
<p>This paragraph is a direct child of the div.</p>
<span>This span is not a direct child of the div.</span>
</div>
<p>This paragraph is not a direct child of the div.</p>
</div>
<div class="example">
<h2 class="example-title">Example 2: Selecting direct child elements with multiple levels of nesting</h2>
<p class="example-description">This example selects and applies styles to all <code>p</code> elements that are direct children of the <code>div</code> element, regardless of the levels of nesting.</p>
<div>
<p>This paragraph is a direct child of the div.</p>
<div>
<p>This paragraph is not a direct child of the div.</p>
<span>This span is not a direct child of the div.</span>
</div>
</div>
<p>This paragraph is not a direct child of the div.</p>
</div>
</body>
</html>