I am trying to utilize Flexbox to center the text content of my site’s Hero section.
However, the site’s Navbar keeps interfering with my attempts. I feel like this is a simple solution that I’m missing, but I cannot seem to figure it out. Probably has something to do with how I have my components structured out.
If you move your navbar outside of your .hero-section element, and give it position: sticky, as per the image below, you should then be good to set your .hero-section element to flex and you should find everything snaps into place!
That did help. However, I’m also trying to get the background image of the hero section to also stretch up to be behind the navbar (which has its background set to transparent). However, the background image of the hero section does not want to extend up to be also behind the navbar.