- This topic has 11 replies, 4 voices, and was last updated 3 years, 2 months ago by
David.
-
AuthorPosts
-
February 24, 2023 at 1:12 am #2545052
SLIM
I for the life of me cannot figure out, how to create GenerateBlocks containers with the new setup.
So I’m setting up a container with display flex. I setup the sizing. ,My page is set to a full width setup. I have a main container setup as a block and the inner container as flex.
If I enable wrap it instantly stacks, despite having the subcontainer widths to 60% + 40%. If I turn off wrapping it doesn’t stack at all.
I know I’m missing something so simple.. just one toggle switch somewhere lol. Please help? Don’t we have a tutorial anywhere??
February 24, 2023 at 1:30 am #2545070Fernando Customer Support
Hi Slim,
Do you want them to stack on some views?
Out of curiosity, why not use a GB Grid Block? Reference: https://docs.generateblocks.com/article/grid-overview/
February 24, 2023 at 5:03 pm #2546054SLIM
Yes naturally… just like the old grid/container elements would. On the a desktop or tablet you’d have them side by side.. but then on a mobile because it won’t be visible – they would have to stack.
February 24, 2023 at 6:25 pm #2546073Leo
StaffCustomer SupportPerhaps this article would provide some insight:
https://docs.generateblocks.com/article/layout-options-overview/I believe you can set the
flex-directiontocolumnon mobile to achieve what you are looking for.If that doesn’t help then please link us to the page in question.
February 27, 2023 at 12:29 am #2548192SLIM
Man I read through that and yes it is basic CSS. but … I feel like there’s a bug and it seems to be effecting all of the sites lol.
Have a look at my video (attached) // As it contains personal URLS i put it the private area.
I actually put two websites to show you guys the kinda bugs I’m getting here lol. Please watch part 1 and part 2 and listen to my commentary.
I’m sure it’s either bugged out, or I’m just missing a SIMPLE option? Going crazy here. Sorry.
GeneratePress has gone from my go-to platform to harder than elementor with this latest update.
February 27, 2023 at 6:17 am #2548526David
StaffCustomer SupportHi there,
the issue is due to a “bug” with how copy and pasted blocks behave.
All GB Blocks have a Unique class.
This class is the specifier for its CSS.
When you copy and paste a block on the same page a new unique class is generated for the copy.
But this does not happen when you paste it into a new page or any post type ( eg an element ).
Sp we end up with a class conflict.This is happening here, as those buttons have the same classes as those buttons in the page hero.
To fix this, edit the footer element, Duplicate those blocks and delete the originals. The duplication will generate CSS classes
February 27, 2023 at 6:25 am #2548538SLIM
David you are a legend. Thank you. This does explain a lot, as naturally I’ve been copy pasting into new containers.
What about the stacking and percentages / wrapping though???
February 27, 2023 at 7:08 am #2548576David
StaffCustomer SupportDoes your parent container Flex have any Column Gap or do the flex children have any horizontal margins ?
February 27, 2023 at 3:46 pm #2549303SLIM
Yes, on the column gaps. But if we can’t have column gaps am I suppose to do just padding and margins on each container? Or is there just no way to gap them?
If you can could you watch the 2nd video, I show detailed examples there.
Also one more question. Will the GRID column eventually be phased out as legacy? Or is that here to stay?
February 28, 2023 at 4:31 am #2549759David
StaffCustomer SupportThe major pitfall with CSS Flexbox is it does not discount Column Gap from the flex containers width.
Instead a Column Gap is kind of interpreted as another flex child.
So in your example a layour with a 10px column gap, results in a layout of:60%10px40%. Which totals greater then 100%, and if flex wrap is enabled it will create a new row to accommodate this.There are several methods to deal with this, but the simplest method is:
1. DO NOT USE the
widthproperty.
2. Select the two inner Containers > Layout > Flex Child, and use Flex:GrowandShrinkprops instead.
3. For both Containers set theshrinkto1– this allows the containers to shrink if needed.
4. Then set each of the child containersgrowas a “fraction” of the space you want it to occupy.
For a 60% / 40% layout – that converts to fractions of:3and2Grid Block will remain albeit it will undergo an upgrade, as it does a lot of the hard-work for you when creating grids with gaps for example. And i would still recommend using it for most cases especially if the end user needs to make simple changes and doesn’t want to learn flexbox.
February 28, 2023 at 5:11 am #2549812SLIM
Hey David,
While I did kinda find my own workaround – it’s great to know this. I personally never dabbed into the flex child area. But it makes sense to me 🙂
Thank you so much!
HOWEVER. I have another small bug regarding the new containers.
The SHAPES? Are they not working or… ?Have a look at my new video. Attached to private info.
—
If anyone is curious about what my work around was.
IT WAS TO SET ONE OF THE CONTAINERS WITH A PERCENTAGE and JUST LEAVE THE OTHER BLANK. It seems to work flawlessly. I also set a column gap in PX and it’s fine.February 28, 2023 at 8:11 am #2550162David
StaffCustomer SupportIf you don’t give a flex child a width or set any flex properties then its width will be defined by its contents.
So if that container was empty, lets say it was just for a background image, and it had no width then it would collapse. Add something inside that container it will grow to fill that 🙂Shapes use Absolute positioning, so they should not be affected by its Containers display properties.
But they are affected by its Postition property, which must be set toRelative -
AuthorPosts
- You must be logged in to reply to this topic.