Bootstrap 4 - Help with responsive hero image on landing page
Hello and (almost) happy new year!
Problem
I've been learning Bootstrap 4 for the past couple of days and need some help with getting a landscape hero image to fill vertically on a landing page while keeping the footer at the bottom of the viewport without scrolling. I think I'm almost there, I just don't know what I don't know!
Background
I've taken 'essential training' courses on lynda.com for both Dreamweaver and Bootstrap 4 and I'm having trouble putting it all together in different situations. I've researched and tried a number of things but I don't have the experience to know what to do when. I know some html and css but this is the first real site I've created from "scratch" start to finish, it's for my wife so It'll get done one way or the other! 🙂
Work
The idea is to create a landing page that has a centered responsive full viewport image with a standard BS 4 menu at the top and footer area that stays at the bottom of the viewport (not sticky) without scrolling, there's not enough content to scroll on any (or most) devices. The rest of the pages will have enough content to scroll so the footer won't be an issue when using the grid, and there will be no full viewport images on other pages.
I've created two versions of the landing page below. Neither is fully fleshed out as I'm working on this issue, and I plan to do media queries to scale the text and add some social icons to the top right of the menu with font-awesome (I think).
v1
This version is the most like what I'm after. The issue is one has to scroll a little to get to the footer. I'm also unable to center the "Knitting designs by Emily Ross" vertically. This uses a background image on the 'header' block element.
I'll try to embed or link to CodePen:
See the Pen BS4 Image v1 by Brian (@briankross) on CodePen.
v2
Since this one uses grid rows and columns I'm thinking vertically aligning "Knitting designs by Emily Ross" will be easier (flexbox, I'm trying to wrap my head around this). The issue here is when the viewport becomes slim, there's white space at the bottom. I thought adding this to css would fix it but sadly not. I'm missing something.
custom-v2.css (partial)
body {
min-height: 100vh;
}
I'll try to embed or link to CodePen:
See the Pen BS4 Image v2 by Brian (@briankross) on CodePen.
If you read this far, thank you! I'm looking forward to your comments. I'm new to all of this, feel free to tell me what I'm doing wrong and what I'm doing right.
- Brian
