1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-23 02:36:11 +02:00
Files
csslayout/contents/dot-navigation.md
2022-09-21 15:25:08 +07:00

940 B

layout, title, description, keywords
layout title description keywords
layouts/post.njk Dot navigation Create dot navigation with CSS flexbox css dot navigation, css flexbox

HTML

<div class="dot-navigation">
    <div class="dot-navigation__item"></div>

    <!-- Repeat other dots -->
    ...
</div>

CSS

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

    /* Reset styles */
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.dot-navigation__item {
    /* Rounded border */
    border-radius: 9999px;
    height: 0.75rem;
    width: 0.75rem;

    /* Inactive dot */
    background-color: transparent;
    border: 1px solid #d1d5db;

    /* OPTIONAL: Spacing between dots */
    margin: 0 0.25rem;
}

/* Active dot */
.dot-navigation__item--active {
    background-color: #d1d5db;
}

{% demo %}{% include "covers/dot-navigation.njk" %}{% enddemo %}