It turns out that I have a grid of thumbs and I'm using flexbox for the first time because of its simplicity and less use of lines in the code.
I want to always place an advertising banner on the top right, the problem is that it is loaded in the third location of the first row, but on large screens where they have more than three columns per row I do not know how to place it in the% style float: right;
. I do not want to use javascript because it takes a few milliseconds to act, and the change is evident.
Here is an illustration in case I did not explain myself well: This is the code for the moment:
body {
margin: 50px;
}
ul {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
list-style-type: none;
padding: 0px;
}
ul li {
width: calc(20% - 15px);
height: 150px;
background-color: #9e9f9a;
margin: 0 15px 20px 0;
}
ul li.ad {
background-color: #ff00d8;
}
<ul>
<li></li>
<li></li>
<li class="ad"></li>
<li></li>
<li></li>
</ul>