Archived topic
Question about container and space
7 replies · Started by Marius on June 22, 2022
Hello,
sometimes I need a colored Box, where i put some text in.
The I add a Container from GPB and click on the Plus Sign and add a praragrap where i put my text. Then i add background color to the container.
Then i set internal spacing to 25 on all sides.
But the result is always, that the space below the text is bigger then above the text. Why is that and how can i make, that it is the same space above and below?
Hi there,
Any chance you can link us to the page in question?
You can use the private information field:
https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Let me know :)
yes, there is a grey box in the text where you can see it.
The extra space is the default bottom-margin added to the paragraph block:
https://www.screencast.com/t/uAG9kNRZx
Try using a headline block instead, then set the bottom margin to 0:
https://docs.generateblocks.com/article/headline-overview/
https://docs.generateblocks.com/article/headline-overview/#spacing
Let me know if this helps :)
But this is no headline. Just text.
In the docs you mentioned, it says: This block isn’t intended to be used for full paragraphs of text.
Also It would not be semantically correct to use a heading here.
Hi Sonja,
You may set the Headline Block to be a Paragraph Block as well: https://share.getcloudapp.com/eDuXjYyl
In this case, you may add long blocks of text.
Alternatively, if you wish to use WP Paragraph Blocks, you can add this CSS in Appearance > Customize > Additional CSS to remove the default bottom margin:
p {
margin-bottom: 0;
}
Hope this helps!
Hi Fernando,
okay, thanks, will try. But what do you mean with "In this case, you may add long blocks of text"?
I usualy have only short text in such a box. Like 2 -3 sentences.
It just means that you can use a paragraph in a Headline block that's all.
I wouldn't recommend using the CSS as Fernando suggested - it will remove all bottom margin for the <p> tag.