This is somewhat of an advanced question about CSS flexbox. I have the following code:
#container {
display: flex;
width: 90px;
flex-flow: wrap;
}
#container button {
width: 27px;
height: 27px;
}
<div id="container">
<button>1</button>
<button>2</button>
<button>3</button>
<button>4</button>
<button>5</button>
<button>6</button>
<button>7</button>
<button>8</button>
<button>9</button>
</div>
and it looks like this:
The assumption is, the 1 to 9 are computer generated, and cannot be altered, and cannot be made into 9 to 1.
With the above restriction, Now using CSS Flexbox, is it possible to make it:
If I merely change the flex-flow line above to:
flex-flow: wrap row-reverse;
it becomes:
and it is not doing the job. The requirement is: can the flow go in reverse direction with the element also in the reverse direction, and starting from the top-right corner?
I can change the flex box to contain 3 rows, and style them accordingly, or, I can make the number in the HTML go from 9 to 1, but what if we can't do that, but have to work with the current HTML structure and pure CSS flexbox style to make it work?