What are after and befor in css? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What are after and befor in css?

15th Jul 2018, 9:07 PM
Sina
Sina - avatar
7 Answers
+ 8
Three elements are used to create a heart: one rhombus and two semicircle. We create one element in HTML with id #heart1, that is the rhombus, then we add pseudo-elements: the first semicircle before the rhombus using #heart1:before and the second semicircle after the rhombus using #heart1:after.
15th Jul 2018, 11:03 PM
NezhnyjVampir
+ 7
You are welcome😊
16th Jul 2018, 11:31 AM
NezhnyjVampir
+ 2
#heart1{ left: 20px; position: relative; width: 90px; height: 90px; background: #f57070; transform: rotate(45deg); -webkit-transform:rotate(45deg); } #heart1:before{ width: 90px; height: 45px; border-top-left-radius: 90px; border-top-right-radius: 90px; background:#f57070; content: ""; position: absolute; bottom:88px; } #heart1:after{ width: 45px; height: 90px; border-bottom-left-radius: 90px; border-top-left-radius:90px; background:#f57070; content: ""; right:88px; position:absolute; }
15th Jul 2018, 9:48 PM
Sina
Sina - avatar
+ 2
What about this code
15th Jul 2018, 9:48 PM
Sina
Sina - avatar
+ 2
what is befor here
15th Jul 2018, 9:49 PM
Sina
Sina - avatar
+ 2
Oh underestood thanks
16th Jul 2018, 8:21 AM
Sina
Sina - avatar