CSS Buttons with Arrows (All 4 sides) Examples

In this article, we will explore how to create interactive arrow buttons using HTML and CSS. These buttons can enhance user experience by providing intuitive navigation options.

HTML Snippet


<div class="button-container">
    <button class="arrow-button up-arrow">
        <span class="arrow"></span>
    </button>
    <button class="arrow-button right-arrow">
        <span class="arrow"></span>
    </button>
    <button class="arrow-button down-arrow">
        <span class="arrow"></span>
    </button>
    <button class="arrow-button left-arrow">
        <span class="arrow"></span>
    </button>
</div>
    

CSS Snippet


.button-container {
    display: flex;
    gap: 10px;
}

.arrow-button {
    width: 60px;
    height: 60px;
    background-color: #ccc;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
}

.arrow-button:hover {
    background-color: #2196F3;
}

.arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
}

.up-arrow .arrow {
    border-width: 0 10px 15px 10px;
    border-color: transparent transparent white transparent;
}

.right-arrow .arrow {
    border-width: 10px 0 10px 15px;
    border-color: transparent transparent transparent white;
}

.down-arrow .arrow {
    border-width: 15px 10px 0 10px;
    border-color: white transparent transparent transparent;
}

.left-arrow .arrow {
    border-width: 10px 15px 10px 0;
    border-color: transparent white transparent transparent;
}
    

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!