Site logo

Archived topic

CSS "absolute" on nested child container required to position it

3 replies · Started by Martin on January 13, 2021

Viewing posts 1–4 of 4

Check https://prnt.sc/wn1fua to see my screenshot of my nested Generate Block (GB) containers:

outer container has background image
inner container has headlines with backgrounds to make text stand out on image

Problem: I can't seem to position the inner container without assigning a class to the container and using this css:

.child_container {
  position: absolute;
}

Where inner container is assigned the class .child_container.

Then I can position the container where I want it using the sidebar margin controls and giving it a suitable width. But without the 'absolute' qualifier on the container it is centered and impossible to place accurately.

Couldn't there be a switch in the sidebar for this absolute qualifier? Or maybe I'm missing something. I thought nested containers would be quite a common requirement...?

Thanks for everything (love GP Premium and Generate Blocks! -awesome combination which I use all the time, with Toolset for custom field types and complex views).

Hi,

Problem: I can’t seem to position the inner container without assigning a class to the container and using this css:

Couldn’t there be a switch in the sidebar for this absolute qualifier? Or maybe I’m missing something. I thought nested containers would be quite a common requirement…?

Position controls isn't added to GenerateBlocks settings as of this moment but you can open an issue on it's github page and have it requested as an added feature.

For now, the best way to do it is to add a unique CSS class for it and write a CSS to add position: absolute; to the unique class selector that you've added.

Couldn’t there be a switch in the sidebar for this absolute qualifier? Or maybe I’m missing something. I thought nested containers would be quite a common requirement…?

You can nest containers by placing a container block on a container block. It's only the the position controls that's lacking, for now.

Thanks Elvin I'll request it. Thanks for the suggestion.

Thanks Elvin I’ll request it. Thanks for the suggestion.

No problem. I've also made Tom aware of this on our end. :)

This archived topic is closed to new replies.