I’m creating a one-line bar that has background-color: black;, for an ecommerce. This div has three sentences, that I organized as spans in the HTML. I must make sure that these sentences are organized one on the right, one on the left, another one in the middle.
span {
display: inline-block;
}
.barraServizioClienti {
width: 100%;
height: 27px;
padding: 4px 15px 4px;
background-color: #121212;
}
.customerServiceItems {
vertical-align: middle;
}
#spedizioniGratis {
text-align: center;
}
#trovaci {
float: right;
}
#servizioClienti a,
#spedizioniGratis,
#trovaci a {
text-decoration: none;
font-size: 14px;
font-weight: 100;
color: #ffffff;
}
<div class="barraServizioClienti">
<p>
<span id="servizioClienti"><a href="home.html">Servizio Clienti</a></span>
<span id="spedizioniGratis">Spedizioni e resi gratuiti</span>
<span id="trovaci"><a href="home.html">Trova il negozio più vicino</a></span>
</p>
</div>
2
Answers
Forget floats, use flexbox with
p {display:flex;justify-content: space-between;}
:In your CSS, where you have called the span classes by the IDs, try adding these lines of code and see,
If that didn’t work try wrapping the all the spans around a div container and check again