1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-23 10:46:13 +02:00
Files
csslayout/contents/teardrop.md
2022-10-02 17:36:49 +07:00

760 B

layout, title, description, keywords
layout title description keywords
layouts/post.njk Teardrop Create a teardrop with CSS css border radius, css teardrop, css water drop shape, css water droplet

HTML

<div class="teardrop">
    <!-- Display the content vertically -->
    <div class="teardrop__content">...</div>
</div>

CSS

.teardrop {
    /* Center the content */
    align-items: center;
    display: flex;
    justify-content: center;

    /* Border */
    border: 2px solid #d1d5db;
    border-radius: 0px 50% 50% 50%;

    /* Angle at the top */
    transform: rotate(45deg);

    /* Size */
    height: 4rem;
    width: 4rem;
}

.teardrop__content {
    transform: rotate(-45deg);
}

{% demo %} {% include "covers/teardrop.njk" %} {% enddemo %}