Overview
I have two div
elements with class col
which each have 50% widths.
I'm trying to have them sit next to each other; however, the second element is at the baseline of the first element:
Code
NB: the left column has a minimum width of 540px so you may need to preview in full screen mode
div.canvas {
background-image: url(//www.transparenttextures.com/patterns/asfalt-dark.png);
padding: 100px 0;
background-color: #F2E394;
text-align: center;
}
div.col {
width: 50%;
display: inline-block;
}
/* Device Mockups */
div#phone {
width: 540px;
height: 540px;
background: url(//i.imgur.com/ieBaiQ1.png);
background-size: contain;
background-position: center center;
position: relative;
margin: 0 auto;
}
div#phone div.frame {
position: absolute;
top: 85px;
bottom: 85px;
left: 165px;
right: 165px;
overflow-x: hidden;
overflow-y: auto;
border-radius: 3px;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
background: white;
}
<div class="canvas">
<div class="col">
<div id="phone">
<div class="frame">
</div>
</div>
</div><div class="col ta-l">
<h1>Header 1</h1>
</div>
</div>
Question
How can I ensure that the right column is vertically aligned with the left column, with the text "Header 1" starting at the same position as the top of the left column?