Despite following numerous tutorials and tips, every time I make a change to center align my content, it ends up breaking something else and pushing me further away from my goal.
While I have successfully centered the content horizontally, I am now struggling to center it vertically as well.
The 'line-height' property is causing issues with my borders, making it even more challenging. Although I thought I had dealt with this problem before, I can't seem to find any previous solutions.
Here is the code snippet:
.parent {
width: 100%;
height: 76px;
border: 1px solid black;
border-radius: 15px;
display: block;
text-align: center;
}
#space {
width: 5px;
display: inline-block;
}
.child {
width: 75px;
display: inline-block;
vertical-align: middle;
border: 1px solid #8CAAD2;
border-radius: 10px;
}
<div class="parent">
<span class="child">Call Us</span>
<div id="space"></div>
<span class="child">Call Us</span>
</div>