0
Hello... guys I’m starting work with flexbox only I’m having a problem when making a menu, follow the css code:
.header{
width: 100%;
height: 100vh;
background-image: url(../img/backgrounds/bg1.jpg);
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
.header .header_content{
max-width: 1366px;
margin: 0 auto;
display: flex;
/*justify-content: space-between;*/
}
.header .header_content .logo{
flex-basis: 247px;
padding: 20px;
width: 207px;
}
.header .header_content .header_content_nav{
flex-basis: calc(100% - 247px);
display: flex;
justify-content: flex-end;
}
.header_content_nav .menu{
display: flex;
align-items: stretch;
}
.header_content_nav .menu li{
list-style: none;
display: flex;
align-items: center;
margin: 0 15px;
}
.header_content_nav .menu li a{
color: #ffffff;
height: 100%;
display: flex;
align-items: center;
text-transform: uppercase;
font-weight: 700;
text-decoration: none;
font-size: 0.9em;
}
.header_content_nav .social_telefone{
display: flex;
align-items: stretch;
}
HTML:
<header class="header">
<div class="header_content">
<div class="logo">
<a>
<img src="logo_med.png" width="207"/>
</a>
</div>
<!--FECHA DIV LOGO-->
<nav class="header_content_nav">
<ul class="social_telefone">
<li><a href="./">link</a></li>
<li><a href="./">link</a></li>
<li><a href="./">link</a></li>
</ul>-->
<ul class="menu">
<li><a href="./">link</a></li>
<li><a href="./">link</a></li>
<li><a href="./">link</a></li>
<li><a href="./">link</a></li>
<li><a href="./">link</a></li>
</ul>
</nav>
</div>
</header>
Only it’s wrong, the social is left and not on the menu! wanted something like this:
Thanks!
With the CSS and HTML of the question could not reproduce the problem.
– Sam
Yes, the problem I posed the question, is the left of the menu, the social_phone, wanted it on top.
– JASL
JASL what he meant is that the CSS you put in the question is not the complete CSS we need to simulate the error equal to the image you posted. Please check if you have put the correct CSS question, and put it in full!
– hugocsl
Friend this that you are proposing with Flexbox is practically impossible to do, he works with Row or colums Anyone you choose won’t get the expected result like the photo. You won’t be able to put two Ivs on top of each other, like the social and menu with Flexbox.
– LeAndrade
@hugocsl the full css is this same one I started today the development and already fall into this problem.
– JASL
@Leandro the flexbox is so limited? suggests something to reverse it?
– JASL
Cara is not that he is limited, he is very good mainly in terms of responsiveness, but in this case I wouldn’t use it, I would use pure CSS, with float, or CSS frameworks, I don’t know what your project is like there, and whether you can use frameworks or not. But the frameworks have menus like this their very easy to be implemented.
– LeAndrade
@Leandro blz, I’ll see how it looks with the float. I don’t use frameworks!
– JASL