I am using a template (https://html5up.net/story) to setup a website for a dog show. It has mostly worked well, but I am having a mystifying problem with the gallery. I am using it to display the logos of the sponsor and I needed to make three different groups of sponsor so I am using the gallery css three times in a row. Gallery 2 and 3 work fine. Gallery 1 renders tiny images even though everything looks the same to me. What am I missing?
The website is https://adventsvalpen.se/ and I am talking about the images under âTack till vĂ„ra huvudsponsorer!â as opposed to the ones under âTack till vĂ„ra försĂ€ljare!â
Iâm gonna need a CSS guru to explain to me why the inner div is inheriting the flex display and then not using flex to manage the articles inside that display⊠why the inner div isnt set to be a flexed sizeâŠ
I can âfixâ the problem by setting flex: 1 on the âinnerâ div⊠but⊠i dunno if thatâs the RIGHT solution because this thingâs got flexing at so many different levels my head spins.
I was having difficulty fathoming why the inner div was not full width.
There seems to be some kind of odd thing going on with width dependency.
The inner has shrunk to fit the (inherent) size of the two images, but then the size of the image containers are defined as 20% of the innerâs width.
So there is kind of a dependency loop here.
Setting flex-grow: 1 does fix it by allowing the inner to expand to full width, as does setting a width or flex-basis for the inner.
I guess the creator never considered a gallery with fewer than 5 images. I would agree it is a bit over-engineered with all the nested flexes.
Oh, never occurred to me that the issue was cropping up because of the number of images. Would it be best to adjust the CSS file or to add a style of flex-grow: 1 on the inner div for the affected gallery only?
The inner div is a nested display:flex and a flex âitemâ is shrink to fit (even if it is also display:flex) so you get a smaller 20% than the others. You need to stretch the inner div to the full width of the parent and then it will be the same.
.gallery.style1 > .inner{
flex:1 0 0;
}
The others work because they have 5 elements pushing the div wider.