- This topic is empty.
-
AuthorPosts
-
May 8, 2018 at 2:32 pm #270815ruby76Participant
I thought I had finally wrapped my head around the core concepts of flexbox, but I have a flex setup where, as soon as the two items in my container “flex,” their HEIGHTS resize so that they overlap with other content above/below that container. I tried applying a red border to the container and can now see that the entire thing isn’t actually resizing; just the interior divs. I’m baffled.
I keep re-reading the tutorial on CSS-Tricks and Googling the problem but feel like I must be missing some very simple concept somewhere. Any ideas?
The site is fairly simple so far (just a splash page), located at https://jetonboylston.com.
I saved the relevant CSS in a pen here: https://codepen.io/ruby76/pen/KRZEMG
(Forgive me for not including the HTML as well – I’ve got a WordPress shortcode in there that plugs in the right-hand content, so it wasn’t showing up in the pen.)
Thanks in advance for any advice!
May 8, 2018 at 9:35 pm #270843BeverleyhParticipantWe’re going to need the HTML in the pen too.
May 8, 2018 at 9:53 pm #270844ruby76ParticipantGot it. Here’s a pen that includes the basic HTML/CSS for this container: https://codepen.io/ruby76/pen/zjRxoN
I removed the WP shortcode and just made the div solid black, for simplicity’s sake, but also updated the pen in my original post with the whole page source if that helps for better visualization of the whole page.
Hope this helps – let me know if I can clarify any better. Thanks for your help!
May 9, 2018 at 1:19 am #270848BeverleyhParticipantThe issue isn’t with flex… the issue is with the heights of the wrapper and its children.
Try removing the 600px height of the wrapper, and give heights to the children instead, either with a responsive technique – e.g. intrinsic/aspect ratios https://css-tricks.com/aspect-ratio-boxes/ – or media queries to change fixed/explicit heights at your desired breakpoints.
May 9, 2018 at 1:35 am #270850PoganyParticipantYou may remove
.location{align-content: center;}
May 9, 2018 at 12:53 pm #270858ruby76ParticipantAh, I hate (but love) it when it’s something simple like that. I got my eyeballs so crossed over flexbox properties that I missed that obviously it was related more to the way I set up the container/interior div heights. I adjusted that and all is well now.
Thanks so much for straightening me out!
May 9, 2018 at 1:00 pm #270859BeverleyhParticipantNo problem – glad you sorted it.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.