Create Heart Shape Using CSS

Create a Heart Shape with the help of HTML and CSS

HTML:

<div class="heart">
    <span></span>
    <span></span>
</div>


CSS:

body{
    background: #000;
}

.heart{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
}

.heart span{
    width: 50px;
    height: 80px;
    background: red;
    border-top-left-radius: 50px;
    border-top-right-radius: 50px;
}
.heart span:nth-child(1){
    transform: rotate(-45deg) translateX(20px);
}
.heart span:nth-child(2){
    transform: rotate(45deg) translateX(-20px);
}

Leave a Comment