BUG: margin settings for image do not work

@dan

when i am setting the margins for images, I noticed that this does not works correctly.

here is a video

btw: same thing with the container and flex

Is the sizing width set to auto?

no. not really. its 100% … but it still shouldn’t be like that. i think so ^^

edit:
OK. it does not work with all elements-components if you have set sizing/size: width to 100%.

that doesn’t really make sense, does it?

Depends on what 100% means - 100% of available space or 100% of original image size or something else? I’m assuming it refers to image size since it’s in the sizing attribute.

Did you try setting it to auto? Did it fix the problem? Alternatively, try using padding (in spacing) instead of margin

Hey @Pegasus

you should put a Container around your text and image. Then it is working as expected. Guess @dan has a technical explanation.

What I can say is that I am using Container, Flex or Grid extensively. A missing container or flex is often the reason why something is not working as expected

@maxken’s comment led me look of this problem from a different angle.

i assume that I simply misunderstood this setting option and therefore did not use it as I should have ^^

Did you get the problem sorted?

If not… I would recommend putting the items in a container :slight_smile:

I did a bit more testing of this issue and discovered the following …

The issue relates to both Image and Video components (possibly others but I only checked the media group) and is triggered by adding width margin to the spacing sizes.

The issue is not resolved by putting the element(s) in a container (there are, of course, other good reasons why they should be in one).

The issue is resolved by changing the sizing width to auto instead of 100% (default).

If there is no specific reason for the default sizing width to be 100%, I suggest changing the default to auto.