I have iframes which are appended by ajax, I want them to be centred on the screen side by side which I have got working but I also want them to start a new line centred again when they are bigger than the DIV width container.
Code below centres a number of iframes but they overflow the container. I tried overflow auto but this did not work
CodePen link
<!DOCTYPE html>
<html>
<head>
<style>
body{
width: 100%;
}
#viewRangerContainer{
border: solid;
position: absoulte;
display: flex;
justify-content: center;
align-items: center;
overflow: auto;
width: 100%;
height: auto;
}
.viewRangerFrame{
border: solid;
position: relative;
display: inline-block;
height: 90px;
width: 8vw;
margin-left: auto;
margin-right: auto;
}
</style>
</head>
<body>
<div id="viewRangerContainer">
<iframe class="viewRangerFrame"></iframe>
<iframe class="viewRangerFrame"></iframe>
<iframe class="viewRangerFrame"></iframe>
<iframe class="viewRangerFrame"></iframe>
<iframe class="viewRangerFrame"></iframe>
<iframe class="viewRangerFrame"></iframe>
<iframe class="viewRangerFrame"></iframe>
<iframe class="viewRangerFrame"></iframe>
<iframe class="viewRangerFrame"></iframe>
<iframe class="viewRangerFrame"></iframe>
<iframe class="viewRangerFrame"></iframe>
<iframe class="viewRangerFrame"></iframe>
</div>
</body>
</html>