I’m trying to create a layout that has 2 columns side by side. 1 contains text over a background image, the other contains a wide image at the top with a block of text below. Here’s a quick sketch from the mockup (wasn’t sure on the best way to link to any image):
So, the problem I have is, how do I align the left column text with that on the right? Obviously they’re in 2 separate divs so don’t really have much of a connection to one another. So that’s the tricky bit.
Here’s a CodePen: https://codepen.io/moy/pen/wPEdjo
So I’ve used flexbox
to set the divs so they have the same height, I’m not sure if that’s the best approach? And currently the text is vertically centred. I thought about aligning the text to the bottom but that wouldn’t do it either, as the text should be centred to be inline with each other, like the sketch.
The only thing I can think of is adding a spacer image the same aspect ratio of the left image. But yet again, the text probably wouldn’t be centred the way I need it? I suppose instead of a spacer I could use the :before
element to the same affect with percentage height/width.
So basically I’m stuck! Any ideas? Is flexbox
the best/only solution for this?