HTML unusual flex wrapping
up vote
0
down vote
favorite
#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.
html css flexbox
add a comment |
up vote
0
down vote
favorite
#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.
html css flexbox
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
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
#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.
html css flexbox
#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
html css flexbox
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
add a comment |
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
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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>
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
add a comment |
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
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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