Question: From an image made up of 9 smaller images arranged as a 3x3-grid like

```
AAA
BBB
CCC

```

i want to automatically generate all possible variations as .pngs, where the position of the smaller images does matter, no position can be empty and and each small image must be present three times. I managed to get a list of these permutations with python:

```
from sympy.utilities.iterables import multiset_permutations
from pprint import pprint
pprint(list(multiset_permutations(['A','A','A','B','B','B','C','C','C'])))

```

resulting in 1680 variations:

```
[['A', 'A', 'A', 'B', 'B', 'B', 'C', 'C', 'C'],
 ['A', 'A', 'A', 'B', 'B', 'C', 'B', 'C', 'C'],
 ['A', 'A', 'A', 'B', 'B', 'C', 'C', 'B', 'C'],
 ['A', 'A', 'A', 'B', 'B', 'C', 'C', 'C', 'B'],
 ['A', 'A', 'A', 'B', 'C', 'B', 'B', 'C', 'C'],
 ['A', 'A', 'A', 'B', 'C', 'B', 'C', 'B', 'C'],
...
 ['C', 'C', 'C', 'B', 'B', 'B', 'A', 'A', 'A']]

```

How can i replace each letter for each line with the respective small images A.png, B.png and C.png, which are all square 1000 x 1000 px, with the first three 1000 px apart, and two more rows below?
Thank you for your help!

Answer: 
Here you should use JavaScript. First, get buttons widths, compare them and then make equal the less button to bigger.

```js
let btn = document.querySelectorAll('button')

if(btn[0].offsetWidth > btn[1].offsetWidth) {
    btn[1].style.width = `${btn[0].offsetWidth}px`
} else {
    btn[0].style.width = `${btn[1].offsetWidth}px`
}

console.log(btn)
```

```css
.container {
    width: 800px;
    height: 100px;
    border: 1px solid black;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }
```

```html
<div class="container">
    <button>Little text (very left)</button>
    <button>This text is way more long than the other (very right)</button>
</div>
```
You can do it simply by changing a little in your code.

```
.container {
    border: 2px solid red;
    padding: 10px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }

```

Here I am just making the outer container flex and setting the flex direction row. This will set both buttons in a single row. Now just add:`justify-content: space-between;` and both the buttons will be aligned as you want.

By the way there is also an alternate method through which you can do this work.
Just give unique id to both the buttons.

```
 <div class="container">
  <button id="btn1">Little text (very left)</button>
  <button id="btn2">This text is way more long than the other (very right)</button>
</div>

```

Now set the `float` property to `left` and `right`

```
#btn{
      float: left;
  }
  #btn2{
      float: right;
  }      

```

I think it should work now. Thanks