I'm making a site that has 3 different span
that sits next to each other by using a float:left
parameter. But this messes up the padding
I have on the wrapper the two elements are contained in.
How can I make them sit next to each other without messing with the padding?
.wrapper {
width: 100%;
padding: 10px 0;
background: red;
}
.box-A {
width: 49%;
float: left;
}
.box-A {
width: 49%;
}
<h1>Not working but aligned</h1>
<div class="wrapper">
<div class="box-A">
Lorem
</div>
<div class="box-A">
Ipsum
<br> Ipsum
<br> Ipsum
<br> Ipsum
<br>
</div>
</div>
<h1>Working, but not aligned</h1>
<div class="wrapper">
<div class="box-B">
Lorem
<br> Lorem
<Br>
</div>
<div class="box-B">
Ipsum
<br> Ipsum
<br>
</div>
</div>