I am attempting to create a layout using flex-direction: column-reverse
in order to swap the positions of button 1 and button 2 without modifying the HTML:
<button>2</button>
<button>1</button>
Unfortunately, I'm encountering an issue where applying flex causes it to become a single line.
.flex {
display: flex;
}
button {
width: 100%;
}
.wrap {
width: 200px;
}
<div class="wrap">
<div class="flex">
<button>2</button>
<button>1</button>
</div>
</div>