I'm encountering a puzzling issue with my side-by-side divs. I have different-size headers in each div, and I want the top header in each to be baseline aligned. Unfortunately, using vertical-align: baseline
doesn't seem to work between the two divs. Below is an excerpt of my code (written in sass):
.about-page-column {
display: inline-block;
vertical-align: top;
width: 49%;
margin-top: 5px;
text-align: center;
padding: 5px;
h3,h4 {
padding: 5px;
vertical-align: baseline; // this line seems ineffective
font-family: 'Rubik', sans-serif;
text-decoration: underline;
color: $page-title-color;
}
h3 {
font-size: 2em;
}
h4 {
font-size: 1.5em;
}
}
<div>
<div class="about-page-column">
<h3>Experience</h3>
</div>
<div class="about-page-column">
<h4>Links</h4>
</div>
</div>
The headers are currently aligning by their tops due to floating to the top of the vertical-align: top
divs.
https://i.sstatic.net/4InXC.png
Could anyone advise on a method to align the headers within their respective divs so they are vertically aligned by their baselines? Alternatively, if this isn't possible, do you know of any effective workaround?
Your help is greatly appreciated!