Archived topic
Container internal margin not working
9 replies · Started by Julien on October 11, 2020
Hello guys,
My container internal margin is set to 40 px (up, down, right and left) and working fine when posting image or texte but not if I insert a "media and text" native wordpress block. No matter if I put the media right or left, it will show as if margin was set to 0 px on the media size. And it's ugly : D
That's a very strange issue. You can check from link inserted in my profile on homepage (photo of me and my son)
Regards
Hi there,
Try unchecking the align wide setting in the media/text block.
Hello Leo,
Thank you but it's unchecked.
regards
Hi there,
The block still has the alignwide class: https://www.screencast.com/t/Mo3TQtJK
This means the alignment is still set. Can you double-check? Usually you need to click the checked option and it will un-check itself (there is no clear/no align button for some reason).
I am sorry I did not get it first. Now it's unchecked but it still doesn't work.
Media is showing fine but the container margin si also changed on the text side with a margin showing something like 80 px instead of 40 px as selected in GP.
Media is showing fine but the container margin si also changed on the text side with a margin showing something like 80 px instead of 40 px as selected in GP.
What your seeing is the default padding added to the block through .wp-block-media-text .wp-block-media-text__content.
This class adds padding: 0 8%;. You can override this by custom CSS.
.wp-block-media-text .wp-block-media-text__content{
padding: 0 5% 0 0;
}
This removes the seemingly unwanted padding on the left so the media text aligns with the other contents on the page.
Thank you Elvin.but it fixes the problem on the text side buit introduces a new problem on the media size with a 0 padding making text touching the media. How to fix it so it looks good with a little padding between media and text ?
Also, isn't it a bug ? Why default block doesn't align with everything else ?
Hi there,
The CSS you have added looks like this:
.wp-block-media-text .wp-block-media-text__content {
padding: 0 0 0 0;
}
Can you change it to the rule that Elvin provided ie.
.wp-block-media-text .wp-block-media-text__content{
padding: 0 5% 0 0;
}
You can change the 5% to any % or pixel value if you want.
Damn ! You are right, it works now.
I will mark as solved.
Thanks
Glad to hear that!