Applied Visual Design: Create a More Complex Shape Using CSS and HTML
<style>
.heart {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: pink;
height: 50px;
width: 50px;
transform: rotate(-45deg);
}
.heart:after {
background-color: pink;
content: "";
border-radius: 50%;
position: absolute;
width: 50px;
height: 50px;
top: 0px;
left: 25px;
}
.heart:before {
content: "";
background-color: pink;
border-radius: 50%;
position: absolute;
width: 50px;
height: 50px;
top: -25px;
left: 0px;
}
</style>
<div class = "heart"></div>
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36.
Challenge: Create a More Complex Shape Using CSS and HTML
Link to the challenge:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
Hi,
Check again your selectors!
Remember that after and before pseudo-elements have not only one ’ : '.
I hope it was clear!
nabila
June 11, 2020, 8:37am
3
Hi!
Try again!
we have tow “::” after and before pseudo-elements not one “:”.
nabila:
“::”
Hi
In the challenge ask me to make heart i have try to do “::” when i did heart change into star i took screenshot of heart and star.
ILM
June 11, 2020, 9:01am
5
what code are you using? if it disappear means you are writing something wrong
i’m using code ::before and ::after In the challenge ask me to make heart i have try to do but it saying that The background-color property of the heart::after selector should be pink. and The content of the heart::before selector should be an empty string.
Please Help
That’s because the content should be an empty string, not ’ content : ;’.
An empty string (content:"";) is different from nothing (content: ; ).
Hope it helped.
nabila
June 11, 2020, 11:56am
8
HI
If you write( .heart::after) in stead of (.hear:after) and write (heart::before) in stead of (heart:before) I think you will pass this challenge .
nabila
June 11, 2020, 12:00pm
9
Coding1234:
.heart:after
your above pseudo-element is not right.
this is the right one: .heart ::after