Skip Navigation

[Resolved] Remove margin around an image

This support ticket is created 3 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by FLORENTW330 3 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#2157393
Screenshot from 2021-09-01 18-43-16.png

Hello,

I build a Content Temple for a single post and I would like to align an image with the text below. Problem is there is margin 40px at the right and the left. So my questions are how can I remove this margin and set the image in full width ?

#2157893
padding-margin-settings.png

Hi,

Thank you for contacting us and I'd be happy to assist.

You'll find the setting to control the padding and margin under the "Style Settings" tab in the image block's options.
( screenshot attached )

Note: you'll also see the option to select image size under the "Image Settings" tab.

regards,
Waqar

#2157969
Screenshot from 2021-09-02 08-54-12.png
Screenshot from 2021-09-02 08-42-36.png

Hello Waqar,

Changing the margin in the Style Settings doesn't work.

As you can see in the screenshot, the margin I want to remove is set to the <figure> HTML element which is above the <img> element.

The problem is that Style Setting apply only to the <img> element.

#2158085

Thank you for sharing the screenshots.

I'm afraid, there is no built-in control available in the image block's settings to adjust the margin & padding for the parent "figure" tag.

For this, you can include a custom class, for example, "custom-margin-wrap", into the image block's "CSS Classes" field, under the "Advanced" tab.
( screenshot: hidden link )

After that, you'll be able to adjust the margin (or any CSS styles) for any "figure" tag from the image block with this special class, using CSS code.

For example:


.wp-block-image.custom-margin-wrap {
    margin: 10px 10px 10px 10px !important;
}

Note: Feel free to adjust the margin values as needed and this CSS code can be included in the "Custom CSS" field in the content template.

#2158143

My issue is resolved now. Thank you!