I am attempting to design a centered navbar for a webpage. The navbar consists of 5 divs and my goal is to have the third div become the first one when the screen size goes below 600px.
Here is the HTML code:
<div class="mainmenu">
<div class="nav">Skills</div>
<div class="nav">Formation</div>
<div class="nav titre">John Doe</div>
<div class="nav">Project</div>
<div class="nav cta">Call me</div>
</div>
And here is the CSS code:
.mainmenu {
display: flex;
flex-direction: row;
flex-wrap: wrap;
height: 60vh;
text-align: center;
justify-content: center;
align-items: center;
overflow: hidden;
width: 100%;
font-size: 17px;
}
.nav {
width: 10%;
margin: 17px;
font-size: 20px;
}
.mainmenu .titre{
font-size: bolder;
font-size: 30px;
}
.cta {
border-radius: 15px;
padding: 18px;
white-space: nowrap;
}
@media screen and (max-width:768px) {
.mainmenu:nth-child(3){
order: 1;
}
}
Despite adjusting the max-width in media queries and trying different approaches, such as reversing the mainmenu flex-direction, I cannot get 'John Doe' to be displayed at the top when the screen size is under 768px. Any advice or suggestions on improving my question-asking skills would be greatly appreciated. Thank you for taking the time to read this.