GitHub 6956★

Have you seen CSS Scan?

The fastest and easiest way to check, copy and edit CSS.

Learn more →

CSS Scan logo

Stepper input

HTML

<div class="stepper-input">
<!-- Minus button -->
<button class="stepper-input__button">-</button>

<!-- Input container -->
<div class="stepper-input__content">
<input type="text" class="stepper-input__input" />
</div>

<!-- Plus button -->
<button class="stepper-input__button">+</button>
</div>

CSS

.stepper-input {
display: flex;

/* Border */
border: 1px solid #d1d5db;
border-radius: 0.25rem;

/* Size */
height: 2rem;
}

.stepper-input__button {
/* Reset */
background: #d1d5db;
border: none;

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

/* Size */
width: 2rem;
}

.stepper-input__content {
flex: 1;
}

.stepper-input__input {
/* Reset */
border: none;

/* Take full size of its container */
height: 100%;
width: 100%;
}
Demo
Follow me on and to get more useful contents.