2
I’m trying to get 1 item lined up on the left and 2 items lined up on the right with Bootstrap 4
, tried to use flexbox
but since there are 3 items in the middle and one at each end, I tried to make the 2 items on the right as a list, but then there is one below the other and not next, so I tried to put one inline-list
in their class but no effect has arisen.
Finally I ended up centralizing with padding and margin, only it is not responsive, and since I am using bootstrap is better to do with it, but with the examples I found in documentation I didn’t get a result.
I need something similar to the footer of ONLY, but in place of the name of the links I will use the logos.
<footer class="footer-bg">
<div class="footer">
<div class="footer-logo">
<a class="navbar-brand js-scroll" href="#page-top"><img src="img/logo.png" alt="Logotipo"></a>
</div>
<nav class="footer-nav">
<ul>
<li><a href="#sobre"><i class="fab fa-linkedin-in"></i></a></li>
<li><a href="#produtos"><i class="fab fa-instagram"></i></a></li>
</ul>
</nav>
</div>
<hr style="border: 1px solid rgba(77,77,77,0.5)">
<p class="text-center">Copyright © 2019 - Todos os direitos reservados <br>
</p>
EDIT
SOLUTION
I was able to solve using the flex classes of bootstrap. It follows documentation from flex.
Class used to leave an item on the far left and 2 items on the far right.
<div class="d-flex bd-highlight mb-3">
<div class="mr-auto p-2 bd-highlight">Flex item</div>
<div class="p-2 bd-highlight">Flex item</div>
<div class="p-2 bd-highlight">Flex item</div>
</div>
I had already done something similar, but in this way as I had said the items stand upright, and the inline-item class does not affect them to let them horizontal.
– Guilherme Rigotti
You speak as li’s?
– LeAndrade
Yes, they’re vertical and I need them horizontal.
– Guilherme Rigotti
I edited the answer, a very simple way to solve this is to remove the tag
ul
, actually do not know why is using lis, could be simply links, without lis.– LeAndrade
I put the LI because as I said in the question was a way to position with the flexbox, but if it is better to remove without problems.
– Guilherme Rigotti
I copied yours and pasted, but the result was different, I edited the question with the result.
– Guilherme Rigotti
He copied the Css too, I removed the Lis and left only the to.
– LeAndrade
Yes I copied the CSS, what happens is that you did not give a float on the logo, so it is right in the middle. But if you give a
float:left
in the logo the text ofCopyright
ends up rising and getting in the middle– Guilherme Rigotti
Strange, I don’t need to give float-left on the logo because by default every element is float left, it doesn’t make sense. But put the hr and the p inside a div that is better to position them, it is not good to leave loose elements like this.
– LeAndrade
I already put them inside a div, but the behavior is the same.
– Guilherme Rigotti
Good guy is strange, in case you would have to see all his css, because only then would have to know what is happening.
– LeAndrade
I was able to solve it using the
bootstrap
. I will edit the answer with the solution,– Guilherme Rigotti
Cool man who solved, would comment that there were other ways to get the expected result, but I found the float-right the simplest.
– LeAndrade