Skip to content

Commit 8c90ba4

Browse files
authored
Update Pseudo-class-and-Pseudo-elements.md
1 parent 3b183b4 commit 8c90ba4

File tree

1 file changed

+14
-58
lines changed

1 file changed

+14
-58
lines changed

docs/CSS/css-basics/Pseudo-class-and-Pseudo-elements.md

Lines changed: 14 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ button:hover {
1919

2020
<BrowserWindow url="http://127.0.0.1:5500/index.html">
2121
<button type="submit">Submit</button>
22-
<style>{`
23-
button:hover {
24-
background-color: lightblue;
25-
}`}
26-
</style>
22+
<style>{`
23+
button:hover {
24+
background-color: lightblue;
25+
}
26+
`}</style>
2727
</BrowserWindow>
2828

2929

@@ -59,9 +59,11 @@ li:nth-child(2) {
5959
<li>BLue</li>
6060
</ul>
6161
<style>
62-
{`li:nth-child(2) {
62+
{`
63+
li:nth-child(2) {
6364
color: green;
64-
}`}
65+
}
66+
`}
6567
</style>
6668
</BrowserWindow>
6769

@@ -76,15 +78,15 @@ li:nth-child(2) {
7678
```
7779

7880
<BrowserWindow url="http://127.0.0.1:5500/index.html">
79-
<div class="container">
81+
<div className="pseudo_container">
8082
<div>Hello</div>
8183
<div>World</div>
8284
</div>
8385
<style>
84-
{`.container div:first-child {
85-
color: blue;
86-
font-weight: bold;
87-
}`}
86+
{`.pseudo_container div:first-child {
87+
color: blue;
88+
font-weight: bold;
89+
}`}
8890
</style>
8991
</BrowserWindow>
9092

@@ -97,18 +99,6 @@ div:nth-of-type(3)
9799
}
98100
```
99101

100-
<BrowserWindow url="http://127.0.0.1:5500/index.html">
101-
<div>Hello</div>
102-
<div>World</div>
103-
<div>!</div>
104-
<style>
105-
{`div:nth-of-type(3)
106-
{
107-
color: red;
108-
}`}
109-
</style>
110-
</BrowserWindow>
111-
112102
## Pseudo Elements
113103

114104
1. `::before` : Inserts content before an element's actual content.
@@ -120,17 +110,6 @@ p::before {
120110
}
121111
```
122112

123-
<BrowserWindow url="http://127.0.0.1:5500/index.html">
124-
<p>Drink More Water</p>
125-
<style>
126-
{`
127-
p::before {
128-
content: "Note: ";
129-
font-weight: bold;
130-
}'}
131-
</style>
132-
</BrowserWindow>
133-
134113
2. `::after` : Inserts content after an element's actual content.
135114

136115
```css
@@ -140,17 +119,6 @@ p::after {
140119
}
141120
```
142121

143-
<BrowserWindow url="http://127.0.0.1:5500/index.html">
144-
<p>Drink More Water</p>
145-
<style>{`
146-
p::after {
147-
content: " - Read more";
148-
font-style: italic;
149-
}
150-
`}
151-
</style>
152-
</BrowserWindow>
153-
154122
3. `::first-line` : Applies styles to the first line of a block-level element.
155123

156124
```css
@@ -159,15 +127,3 @@ p::first-line {
159127
font-weight: bold;
160128
}
161129
```
162-
163-
<BrowserWindow url="http://127.0.0.1:5500/index.html">
164-
<p>You are Amazing!</p>
165-
<style>
166-
{`p::first-line {
167-
color: red;
168-
font-weight: bold;
169-
}
170-
`}
171-
</style>
172-
</BrowserWindow>
173-

0 commit comments

Comments
 (0)