HTML unusual flex wrapping











up vote
0
down vote

favorite












Screenshot






#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 it possible to put each second element in the flex to the next row? (Use orders already)
I have an inline menu with 9 buttons. 2nd, 4th, 6th and 8th element is a symblol of a social network. 1, 3, 5, 7, 9 - are just site's links. Do you know how to make them stay on different lines, when width of the screen is smaller than xxx pixels? I tried to use "@media" but it seems like I have to change sides' margins each 5 pixels to make them stay on places what is impossible long way to do so. May be there is another way for this. Please, help.










share|improve this question
























  • Please post your existing HTML and CSS code as a working code snippet.
    – fubar
    Nov 22 at 1:43












  • @fubar Ok, I did
    – ross rykov
    Nov 22 at 2:14










  • If you can modify the html, can you break this into 2 divs?
    – fmontes
    Nov 22 at 2:37










  • @fmontes May be... But I don't know how 🤷
    – ross rykov
    Nov 22 at 2:42















up vote
0
down vote

favorite












Screenshot






#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 it possible to put each second element in the flex to the next row? (Use orders already)
I have an inline menu with 9 buttons. 2nd, 4th, 6th and 8th element is a symblol of a social network. 1, 3, 5, 7, 9 - are just site's links. Do you know how to make them stay on different lines, when width of the screen is smaller than xxx pixels? I tried to use "@media" but it seems like I have to change sides' margins each 5 pixels to make them stay on places what is impossible long way to do so. May be there is another way for this. Please, help.










share|improve this question
























  • Please post your existing HTML and CSS code as a working code snippet.
    – fubar
    Nov 22 at 1:43












  • @fubar Ok, I did
    – ross rykov
    Nov 22 at 2:14










  • If you can modify the html, can you break this into 2 divs?
    – fmontes
    Nov 22 at 2:37










  • @fmontes May be... But I don't know how 🤷
    – ross rykov
    Nov 22 at 2:42













up vote
0
down vote

favorite









up vote
0
down vote

favorite











Screenshot






#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 it possible to put each second element in the flex to the next row? (Use orders already)
I have an inline menu with 9 buttons. 2nd, 4th, 6th and 8th element is a symblol of a social network. 1, 3, 5, 7, 9 - are just site's links. Do you know how to make them stay on different lines, when width of the screen is smaller than xxx pixels? I tried to use "@media" but it seems like I have to change sides' margins each 5 pixels to make them stay on places what is impossible long way to do so. May be there is another way for this. Please, help.










share|improve this question















Screenshot






#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 it possible to put each second element in the flex to the next row? (Use orders already)
I have an inline menu with 9 buttons. 2nd, 4th, 6th and 8th element is a symblol of a social network. 1, 3, 5, 7, 9 - are just site's links. Do you know how to make them stay on different lines, when width of the screen is smaller than xxx pixels? I tried to use "@media" but it seems like I have to change sides' margins each 5 pixels to make them stay on places what is impossible long way to do so. May be there is another way for this. Please, help.






#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>





#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>






html css flexbox






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 at 2:33









Brad

113k25224383




113k25224383










asked Nov 22 at 1:33









ross rykov

82




82












  • Please post your existing HTML and CSS code as a working code snippet.
    – fubar
    Nov 22 at 1:43












  • @fubar Ok, I did
    – ross rykov
    Nov 22 at 2:14










  • If you can modify the html, can you break this into 2 divs?
    – fmontes
    Nov 22 at 2:37










  • @fmontes May be... But I don't know how 🤷
    – ross rykov
    Nov 22 at 2:42


















  • Please post your existing HTML and CSS code as a working code snippet.
    – fubar
    Nov 22 at 1:43












  • @fubar Ok, I did
    – ross rykov
    Nov 22 at 2:14










  • If you can modify the html, can you break this into 2 divs?
    – fmontes
    Nov 22 at 2:37










  • @fmontes May be... But I don't know how 🤷
    – ross rykov
    Nov 22 at 2:42
















Please post your existing HTML and CSS code as a working code snippet.
– fubar
Nov 22 at 1:43






Please post your existing HTML and CSS code as a working code snippet.
– fubar
Nov 22 at 1:43














@fubar Ok, I did
– ross rykov
Nov 22 at 2:14




@fubar Ok, I did
– ross rykov
Nov 22 at 2:14












If you can modify the html, can you break this into 2 divs?
– fmontes
Nov 22 at 2:37




If you can modify the html, can you break this into 2 divs?
– fmontes
Nov 22 at 2:37












@fmontes May be... But I don't know how 🤷
– ross rykov
Nov 22 at 2:42




@fmontes May be... But I don't know how 🤷
– ross rykov
Nov 22 at 2:42












2 Answers
2






active

oldest

votes

















up vote
0
down vote



accepted










I'm going to assume the links actually vary, i.e "Band" will link to something different than "Facebook".



As it's mentioned in comment you only want to to this at small screen sizes we can use media queries and CSS grid to good effect here. Note that CSS grid does have some compatibility issues: https://caniuse.com/#feat=css-grid






#menu {

align-items: center;
margin: 0 5px 0 5px;
height: 30px;
/*The Default grid*/
display:grid;
grid-template-columns: repeat(9, 1fr);
}

#menu a {justify-self: center;}


/*For Smaller screen sizes*/
@media screen and (max-width:800px)
{
#menu {
grid-template-columns: repeat(5, 1fr);
grid-template-rows: 1fr 1fr;
}

/*Set the social links to be on row 2*/
#menu .social {
grid-row-start:2;
}


}

<div id="menu">
<a href="band.html">Band</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/facebook.png"></a>
<a href="band.html">Photos</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/instagram.png"></a>
<a href="band.html">Video</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/vk.png"></a>
<a href="band.html">Merch</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/youtube.png"></a>
<a href="band.html">Contacts</a>
</div>





In the demo hit the "Full page" link to see the larger screen grid in action.






share|improve this answer





















  • Yes! Flex is what I needed for this! Thank you!
    – ross rykov
    Nov 25 at 23:59










  • @rossrykov No problem, don't forget to up vote and/or accept (click the tick)if my answer has helped you.
    – Jon P
    Nov 26 at 0:24


















up vote
0
down vote













Try this:



<div id="menu">
<div class="nav">
<div class="menu_item"><a href="band.html">Band</a></div>
<div class="menu_item"><a href="band.html">Photos</a></div>
<div class="menu_item"><a href="band.html">Video</a></div>
<div class="menu_item"><a href="band.html">Merch</a></div>
<div class="menu_item"><a href="band.html">Contacts</a></div>
</div>

<div class="social">
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/facebook.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/instagram.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/vk.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/youtube.png"></a></div>
</div>
</div>


And CSS:



.nav, .social {
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;
}


Let me know how it goes.






share|improve this answer





















  • Heh, that would be too easy :-) The main thing is to make it look different on smaller screens only.. If there is no way, I will just use two "div"'s
    – ross rykov
    Nov 22 at 2:52











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53422723%2fhtml-unusual-flex-wrapping%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










I'm going to assume the links actually vary, i.e "Band" will link to something different than "Facebook".



As it's mentioned in comment you only want to to this at small screen sizes we can use media queries and CSS grid to good effect here. Note that CSS grid does have some compatibility issues: https://caniuse.com/#feat=css-grid






#menu {

align-items: center;
margin: 0 5px 0 5px;
height: 30px;
/*The Default grid*/
display:grid;
grid-template-columns: repeat(9, 1fr);
}

#menu a {justify-self: center;}


/*For Smaller screen sizes*/
@media screen and (max-width:800px)
{
#menu {
grid-template-columns: repeat(5, 1fr);
grid-template-rows: 1fr 1fr;
}

/*Set the social links to be on row 2*/
#menu .social {
grid-row-start:2;
}


}

<div id="menu">
<a href="band.html">Band</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/facebook.png"></a>
<a href="band.html">Photos</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/instagram.png"></a>
<a href="band.html">Video</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/vk.png"></a>
<a href="band.html">Merch</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/youtube.png"></a>
<a href="band.html">Contacts</a>
</div>





In the demo hit the "Full page" link to see the larger screen grid in action.






share|improve this answer





















  • Yes! Flex is what I needed for this! Thank you!
    – ross rykov
    Nov 25 at 23:59










  • @rossrykov No problem, don't forget to up vote and/or accept (click the tick)if my answer has helped you.
    – Jon P
    Nov 26 at 0:24















up vote
0
down vote



accepted










I'm going to assume the links actually vary, i.e "Band" will link to something different than "Facebook".



As it's mentioned in comment you only want to to this at small screen sizes we can use media queries and CSS grid to good effect here. Note that CSS grid does have some compatibility issues: https://caniuse.com/#feat=css-grid






#menu {

align-items: center;
margin: 0 5px 0 5px;
height: 30px;
/*The Default grid*/
display:grid;
grid-template-columns: repeat(9, 1fr);
}

#menu a {justify-self: center;}


/*For Smaller screen sizes*/
@media screen and (max-width:800px)
{
#menu {
grid-template-columns: repeat(5, 1fr);
grid-template-rows: 1fr 1fr;
}

/*Set the social links to be on row 2*/
#menu .social {
grid-row-start:2;
}


}

<div id="menu">
<a href="band.html">Band</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/facebook.png"></a>
<a href="band.html">Photos</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/instagram.png"></a>
<a href="band.html">Video</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/vk.png"></a>
<a href="band.html">Merch</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/youtube.png"></a>
<a href="band.html">Contacts</a>
</div>





In the demo hit the "Full page" link to see the larger screen grid in action.






share|improve this answer





















  • Yes! Flex is what I needed for this! Thank you!
    – ross rykov
    Nov 25 at 23:59










  • @rossrykov No problem, don't forget to up vote and/or accept (click the tick)if my answer has helped you.
    – Jon P
    Nov 26 at 0:24













up vote
0
down vote



accepted







up vote
0
down vote



accepted






I'm going to assume the links actually vary, i.e "Band" will link to something different than "Facebook".



As it's mentioned in comment you only want to to this at small screen sizes we can use media queries and CSS grid to good effect here. Note that CSS grid does have some compatibility issues: https://caniuse.com/#feat=css-grid






#menu {

align-items: center;
margin: 0 5px 0 5px;
height: 30px;
/*The Default grid*/
display:grid;
grid-template-columns: repeat(9, 1fr);
}

#menu a {justify-self: center;}


/*For Smaller screen sizes*/
@media screen and (max-width:800px)
{
#menu {
grid-template-columns: repeat(5, 1fr);
grid-template-rows: 1fr 1fr;
}

/*Set the social links to be on row 2*/
#menu .social {
grid-row-start:2;
}


}

<div id="menu">
<a href="band.html">Band</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/facebook.png"></a>
<a href="band.html">Photos</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/instagram.png"></a>
<a href="band.html">Video</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/vk.png"></a>
<a href="band.html">Merch</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/youtube.png"></a>
<a href="band.html">Contacts</a>
</div>





In the demo hit the "Full page" link to see the larger screen grid in action.






share|improve this answer












I'm going to assume the links actually vary, i.e "Band" will link to something different than "Facebook".



As it's mentioned in comment you only want to to this at small screen sizes we can use media queries and CSS grid to good effect here. Note that CSS grid does have some compatibility issues: https://caniuse.com/#feat=css-grid






#menu {

align-items: center;
margin: 0 5px 0 5px;
height: 30px;
/*The Default grid*/
display:grid;
grid-template-columns: repeat(9, 1fr);
}

#menu a {justify-self: center;}


/*For Smaller screen sizes*/
@media screen and (max-width:800px)
{
#menu {
grid-template-columns: repeat(5, 1fr);
grid-template-rows: 1fr 1fr;
}

/*Set the social links to be on row 2*/
#menu .social {
grid-row-start:2;
}


}

<div id="menu">
<a href="band.html">Band</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/facebook.png"></a>
<a href="band.html">Photos</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/instagram.png"></a>
<a href="band.html">Video</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/vk.png"></a>
<a href="band.html">Merch</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/youtube.png"></a>
<a href="band.html">Contacts</a>
</div>





In the demo hit the "Full page" link to see the larger screen grid in action.






#menu {

align-items: center;
margin: 0 5px 0 5px;
height: 30px;
/*The Default grid*/
display:grid;
grid-template-columns: repeat(9, 1fr);
}

#menu a {justify-self: center;}


/*For Smaller screen sizes*/
@media screen and (max-width:800px)
{
#menu {
grid-template-columns: repeat(5, 1fr);
grid-template-rows: 1fr 1fr;
}

/*Set the social links to be on row 2*/
#menu .social {
grid-row-start:2;
}


}

<div id="menu">
<a href="band.html">Band</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/facebook.png"></a>
<a href="band.html">Photos</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/instagram.png"></a>
<a href="band.html">Video</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/vk.png"></a>
<a href="band.html">Merch</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/youtube.png"></a>
<a href="band.html">Contacts</a>
</div>





#menu {

align-items: center;
margin: 0 5px 0 5px;
height: 30px;
/*The Default grid*/
display:grid;
grid-template-columns: repeat(9, 1fr);
}

#menu a {justify-self: center;}


/*For Smaller screen sizes*/
@media screen and (max-width:800px)
{
#menu {
grid-template-columns: repeat(5, 1fr);
grid-template-rows: 1fr 1fr;
}

/*Set the social links to be on row 2*/
#menu .social {
grid-row-start:2;
}


}

<div id="menu">
<a href="band.html">Band</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/facebook.png"></a>
<a href="band.html">Photos</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/instagram.png"></a>
<a href="band.html">Video</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/vk.png"></a>
<a href="band.html">Merch</a>
<a href="band.html" class="social"><img class="socials" src="images/socials/youtube.png"></a>
<a href="band.html">Contacts</a>
</div>






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 22 at 5:09









Jon P

11.5k73458




11.5k73458












  • Yes! Flex is what I needed for this! Thank you!
    – ross rykov
    Nov 25 at 23:59










  • @rossrykov No problem, don't forget to up vote and/or accept (click the tick)if my answer has helped you.
    – Jon P
    Nov 26 at 0:24


















  • Yes! Flex is what I needed for this! Thank you!
    – ross rykov
    Nov 25 at 23:59










  • @rossrykov No problem, don't forget to up vote and/or accept (click the tick)if my answer has helped you.
    – Jon P
    Nov 26 at 0:24
















Yes! Flex is what I needed for this! Thank you!
– ross rykov
Nov 25 at 23:59




Yes! Flex is what I needed for this! Thank you!
– ross rykov
Nov 25 at 23:59












@rossrykov No problem, don't forget to up vote and/or accept (click the tick)if my answer has helped you.
– Jon P
Nov 26 at 0:24




@rossrykov No problem, don't forget to up vote and/or accept (click the tick)if my answer has helped you.
– Jon P
Nov 26 at 0:24












up vote
0
down vote













Try this:



<div id="menu">
<div class="nav">
<div class="menu_item"><a href="band.html">Band</a></div>
<div class="menu_item"><a href="band.html">Photos</a></div>
<div class="menu_item"><a href="band.html">Video</a></div>
<div class="menu_item"><a href="band.html">Merch</a></div>
<div class="menu_item"><a href="band.html">Contacts</a></div>
</div>

<div class="social">
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/facebook.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/instagram.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/vk.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/youtube.png"></a></div>
</div>
</div>


And CSS:



.nav, .social {
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;
}


Let me know how it goes.






share|improve this answer





















  • Heh, that would be too easy :-) The main thing is to make it look different on smaller screens only.. If there is no way, I will just use two "div"'s
    – ross rykov
    Nov 22 at 2:52















up vote
0
down vote













Try this:



<div id="menu">
<div class="nav">
<div class="menu_item"><a href="band.html">Band</a></div>
<div class="menu_item"><a href="band.html">Photos</a></div>
<div class="menu_item"><a href="band.html">Video</a></div>
<div class="menu_item"><a href="band.html">Merch</a></div>
<div class="menu_item"><a href="band.html">Contacts</a></div>
</div>

<div class="social">
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/facebook.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/instagram.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/vk.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/youtube.png"></a></div>
</div>
</div>


And CSS:



.nav, .social {
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;
}


Let me know how it goes.






share|improve this answer





















  • Heh, that would be too easy :-) The main thing is to make it look different on smaller screens only.. If there is no way, I will just use two "div"'s
    – ross rykov
    Nov 22 at 2:52













up vote
0
down vote










up vote
0
down vote









Try this:



<div id="menu">
<div class="nav">
<div class="menu_item"><a href="band.html">Band</a></div>
<div class="menu_item"><a href="band.html">Photos</a></div>
<div class="menu_item"><a href="band.html">Video</a></div>
<div class="menu_item"><a href="band.html">Merch</a></div>
<div class="menu_item"><a href="band.html">Contacts</a></div>
</div>

<div class="social">
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/facebook.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/instagram.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/vk.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/youtube.png"></a></div>
</div>
</div>


And CSS:



.nav, .social {
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;
}


Let me know how it goes.






share|improve this answer












Try this:



<div id="menu">
<div class="nav">
<div class="menu_item"><a href="band.html">Band</a></div>
<div class="menu_item"><a href="band.html">Photos</a></div>
<div class="menu_item"><a href="band.html">Video</a></div>
<div class="menu_item"><a href="band.html">Merch</a></div>
<div class="menu_item"><a href="band.html">Contacts</a></div>
</div>

<div class="social">
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/facebook.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/instagram.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/vk.png"></a></div>
<div class="menu_item2"><a href="band.html"><img class="socials" src="images/socials/youtube.png"></a></div>
</div>
</div>


And CSS:



.nav, .social {
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;
}


Let me know how it goes.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 22 at 2:47









fmontes

22318




22318












  • Heh, that would be too easy :-) The main thing is to make it look different on smaller screens only.. If there is no way, I will just use two "div"'s
    – ross rykov
    Nov 22 at 2:52


















  • Heh, that would be too easy :-) The main thing is to make it look different on smaller screens only.. If there is no way, I will just use two "div"'s
    – ross rykov
    Nov 22 at 2:52
















Heh, that would be too easy :-) The main thing is to make it look different on smaller screens only.. If there is no way, I will just use two "div"'s
– ross rykov
Nov 22 at 2:52




Heh, that would be too easy :-) The main thing is to make it look different on smaller screens only.. If there is no way, I will just use two "div"'s
– ross rykov
Nov 22 at 2:52


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53422723%2fhtml-unusual-flex-wrapping%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

What visual should I use to simply compare current year value vs last year in Power BI desktop

How to ignore python UserWarning in pytest?

Alexandru Averescu