https://i.sstatic.net/ekVr4.png
#menu {
display: flex;
justify-content: space-evenly;
align-items: center;
margin: 0 5px 0 5px;
height: 30px;
flex-wrap: wrap;
}
.menu_item {
margin: 0 10px 0 10px;
}
.menu_item2 {
margin: 0 10px 0 10px;
}
<div id="menu">
<div class="menu_item"><a href="band.html">Band</a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/facebook.png"></a></div>
<div class="menu_item"><a href="band.html">Photos</a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/instagram.png"></a></div>
<div class="menu_item"><a href="band.html">Video</a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/vk.png"></a></div>
<div class="menu_item"><a href="band.html">Merch</a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/youtube.png"></a></div>
<div class="menu_item"><a href="band.html">Contacts</a></div>
</div>
Is there a way to move every second element in the flex container to the next row while maintaining their order? I have a horizontal menu with 9 buttons. The 2nd, 4th, 6th, and 8th elements are symbols of social networks, while the 1st, 3rd, 5th, 7th, and 9th are site links. How can I ensure that they appear on separate lines when the screen width is less than xxx pixels? I attempted using "@media" queries, but adjusting margins for each element individually seems inefficient. Is there a more effective method to achieve this layout? Your assistance would be greatly appreciated.