Seudo Element in CSS

6 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€43.65
List Price:  €61.12
You save:  €17.46
£37.73
List Price:  £52.83
You save:  £15.09
CA$68.48
List Price:  CA$95.88
You save:  CA$27.39
A$71.16
List Price:  A$99.63
You save:  A$28.47
S$64.02
List Price:  S$89.63
You save:  S$25.61
HK$391.46
List Price:  HK$548.08
You save:  HK$156.61
CHF 39.45
List Price:  CHF 55.24
You save:  CHF 15.78
NOK kr486.15
List Price:  NOK kr680.65
You save:  NOK kr194.49
DKK kr326.22
List Price:  DKK kr456.73
You save:  DKK kr130.51
NZ$85.85
List Price:  NZ$120.20
You save:  NZ$34.34
د.إ183.58
List Price:  د.إ257.03
You save:  د.إ73.45
৳6,144.50
List Price:  ৳8,602.80
You save:  ৳2,458.29
₹4,620.07
List Price:  ₹6,468.47
You save:  ₹1,848.39
RM196.48
List Price:  RM275.09
You save:  RM78.61
₦69,356.62
List Price:  ₦97,104.82
You save:  ₦27,748.20
₨13,981.74
List Price:  ₨19,575.56
You save:  ₨5,593.81
฿1,626.04
List Price:  ฿2,276.59
You save:  ฿650.55
₺2,209.10
List Price:  ₺3,092.92
You save:  ₺883.81
B$268.30
List Price:  B$375.65
You save:  B$107.34
R843.76
List Price:  R1,181.33
You save:  R337.57
Лв85.38
List Price:  Лв119.54
You save:  Лв34.16
₩74,787.50
List Price:  ₩104,708.49
You save:  ₩29,920.98
₪156.79
List Price:  ₪219.52
You save:  ₪62.72
₱2,989.35
List Price:  ₱4,185.33
You save:  ₱1,195.98
¥7,964.55
List Price:  ¥11,151.01
You save:  ¥3,186.45
MX$891.91
List Price:  MX$1,248.74
You save:  MX$356.83
QR182.02
List Price:  QR254.85
You save:  QR72.82
P682.34
List Price:  P955.34
You save:  P272.99
KSh6,462.70
List Price:  KSh9,048.30
You save:  KSh2,585.60
E£2,620.81
List Price:  E£3,669.34
You save:  E£1,048.53
ብር7,816.27
List Price:  ብር10,943.40
You save:  ብር3,127.13
Kz45,597.42
List Price:  Kz63,840.04
You save:  Kz18,242.62
CLP$46,025.29
List Price:  CLP$64,439.09
You save:  CLP$18,413.80
CN¥344.74
List Price:  CN¥482.66
You save:  CN¥137.92
RD$3,076.41
List Price:  RD$4,307.22
You save:  RD$1,230.81
DA6,623.73
List Price:  DA9,273.75
You save:  DA2,650.02
FJ$110.99
List Price:  FJ$155.39
You save:  FJ$44.40
Q384
List Price:  Q537.63
You save:  Q153.63
GY$10,476.18
List Price:  GY$14,667.49
You save:  GY$4,191.31
ISK kr6,296.24
List Price:  ISK kr8,815.24
You save:  ISK kr2,519
DH471.62
List Price:  DH660.30
You save:  DH188.68
L875.48
List Price:  L1,225.75
You save:  L350.26
ден2,692.03
List Price:  ден3,769.07
You save:  ден1,077.03
MOP$403.66
List Price:  MOP$565.16
You save:  MOP$161.49
N$841.02
List Price:  N$1,177.50
You save:  N$336.47
C$1,842.53
List Price:  C$2,579.69
You save:  C$737.15
रु7,395.40
List Price:  रु10,354.15
You save:  रु2,958.75
S/172.68
List Price:  S/241.76
You save:  S/69.08
K218.96
List Price:  K306.56
You save:  K87.60
SAR187.58
List Price:  SAR262.64
You save:  SAR75.05
ZK974.65
List Price:  ZK1,364.60
You save:  ZK389.94
L222.40
List Price:  L311.38
You save:  L88.98
Kč1,066.96
List Price:  Kč1,493.84
You save:  Kč426.87
Ft17,099.08
List Price:  Ft23,940.09
You save:  Ft6,841
SEK kr470.37
List Price:  SEK kr658.56
You save:  SEK kr188.18
ARS$69,898.52
List Price:  ARS$97,863.52
You save:  ARS$27,965
Bs346.01
List Price:  Bs484.45
You save:  Bs138.43
COP$184,354.73
List Price:  COP$258,111.38
You save:  COP$73,756.64
₡23,559.94
List Price:  ₡32,985.81
You save:  ₡9,425.86
L1,325.48
List Price:  L1,855.78
You save:  L530.30
₲323,053.08
List Price:  ₲452,300.17
You save:  ₲129,247.08
$U2,018.88
List Price:  $U2,826.59
You save:  $U807.71
zł186.41
List Price:  zł260.99
You save:  zł74.57
Already have an account? Log In

Transcript

Today is we are going to discuss about the pseudo elements. So basically, a pseudo elements is used to style specific parts of an element. So how, first of all I'm going to come up with this we can easily get the code I'm seeing I have some like I'm seeing I have some paragraphs, not some one paragraph. One thing, this is my para and copy this variable. Okay, okay, a lot of that. eliminated Okay, now I'm saying that Sorry, I'm saying that I have.

I'm going to comment this so you can also easily get the cold now I'm seeing all that was sink. single paragraph in my file or on the file, I'm seeing paragraph I want to add the code to the page refresh the page. As you can see, this is the two lines of code. So now where is the code is, now I'm saying okay, because the I'm using, I'm saying, I have come in this morning. Okay, so now I'm saying I have three, three lines of code. I'm saying only add the color.

First line. Color equals All right, go to the page, refresh the page. Now as you can see, it's adding the color at the first line and the first line, okay? So now in this way you can use or you can define your pseudo element selector. Okay? pseudo element.

Okay, so now i'm saying i have a paragraph. Okay, now I'm saying, just add a color of a first letter. So how can you do that? I'm saying this, we can easily get the code. I'm saying I have, okay. I'm going to create another paragraph.

Okay, here I'm saying class on this pattern, my path. Okay, this is the pattern. And now I'm saying this is pattern one. This is paragraph one. Now I'm saying this is the one consolidate, I'm thinking this is the para two. Now I'm saying just add the first letter equals two, right.

Now in thing color equals two, go to the page refresh the page. So now as you can see, it's just adding the color. The first letter, okay, so now, you can also use the after and before for suppose I'm saying I have two paragraphs para one paragraph. Now I want to add the image before the paragraph This is how can you do that? I'm saying That's also use. Also use the before property to an image how I'm saying the content content is make sure you have to use the URL to set your image.

So I'm saying the image is logo dot png, make sure go to the page refresh the page. So you have added the image here. I'm saying the vert is going to fix it with a refresh the page. Okay, now I have to find some teeny image. Image. width is not okay, now I'm saying I'm Rich 5050 by 50 So it's a 50 by 50 with a 50 by 50 image.

It's a 50 by 50 image now I'm seeing in the CSS folder assets I'm seeing IMG, so it's a JPEG image 50 by 50. I'm saying this is the JPEG image. img and this is a jpg, go to the page, refresh the page. Okay, so now as you can see, it's adding color. So large file so that's why it's showing you like this, but you can add the image like this for suppose if you want to add after the element, just use the off the property to the page. Refresh the page.

Now as you can see, it's adding the paragraph after your element so you can use the before and also the F after pseudo element or you can just say that these are the pseudo elements. Okay, so now, I think this is enough for today in the next lecture we are going to cover some other topics. Thank you for

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.