My dilemma is unique: while many struggle with vertically aligning elements, I face the opposite issue. The contents of my button are currently vertically aligned, but I want them to wrap around like a normal <div>
while retaining its clickable functionality.
To illustrate, the button has fixed dimensions and should display its content as shown in this image.
button {
display: inline-block;
width: 150px;
height: 100px;
background-color: #ddd;
color: black;
border: 2px solid #aaa;
text-align: left;
padding: 5px;
vertical-align: top;
font: inherit;
}
.c1 {
display: block;
font-size: 20px;
color: gray;
padding-bottom: 5px;
}
.c2, .c3 {
display: inline-block;
background-color: purple;
color: white;
padding: 0 6px;
border-radius: 100%;
}
<button>
<span class="c1">1</span>
<span class="c2">2</span>
<span class="c3">3</span>
</button>