I am working on the Holy Grail layout challenge, and I have gotten it to what I would consider to be 95% of the way there by modelling the “Solved By Flexbox” website. On the left of the “ul” (styled with .thumbnail-item in css), there seems to be an extra 40px of padding that I did not put in the css. Please see the box model diagram in the screenshot…
In Chrome Dev Tools, I do see “-webkit-padding-start: 40px;” in the user agent stylesheet, but I do not know how it got there. Does this have something to do with the way flexbox draws elements on the page?
By default, many browsers have styling for <ul> tags that adds a left padding area for bullets. To get rid of it, you should be able to add styling like this:
.thumbnail-list-left {
padding-left: 0;
}
Or you could add a thumbnail-list class to both the left and right thumbnail lists, and change the above CSS code’s selector to .thumbnail-list to make a reusable class. Either way has merits!
Thanks for your response. Actually, I misspoke. It looks like there is mystery content in both nav columns (in “blue” in Dev Tools) that is messing up the spacing. See screenshots - any ideas?
It’s a bit tricky to tell from that particular screenshot; here are a couple possibilities:
The otter list items could have a margin-right that is expanding the ul container.
The thumbnail-lists could have a width, min-width, or flex value. For example, if you have flex: 1 on them, they will expand to take up 1/3 of the available space. Try inspecting the styles of the thumbnail-list-left/right and look for flex related properties.
Hmmmmmmm. The .thumbnail-list-left and .thumbnail-list-right selectors had flex properties of flex: 0 0 12em;
If I change the flex-basis to 10em, it seems to look a lot better, but this does not sound like a stable solution - more like how it looks on my particular screen size at the time. I have included the relevant css selectors here - not sure what else I can do… Thanks for taking the time to look at this interesting problem.
The flex: 0 0 10em; line may be causing the trouble; to let the sidebars use their “natural” size, disable that flex line, then make sure you have flex: 1 on the detail-image-container.
This will tell the browser that when there is extra space, it should just flex the detail-image-container rather than touching the thumbnail-lists.
I think this shows a different problem: before, your media queries enabled a vertical version of the sidebar (thumbnails are stacked on top of each other instead of from left-to-right). See if you can get the vertical stacking back (usually display: block) instead of left-to-right layout.