0

I noticed that there are differences in the way inline images are displayed when added to 'Body' of the 'Basic Page' and 'Body' of a 'Basic block'. In the first case the image is internally scaled down to match the width of the container (added attribute 'width=909' [screenshot 1]) whilst in the second case the image spills out over the element [screenshot 2]

Basic page body image

Basic block body image

I looked at image styles and field display options but couldn't figure out what is causing this behaviour. I'd like to preserve the scaling of the 'Basic Page' for the blocks. Has anyone else come across this issue? I'm running Drupal 8.1.9.

EDIT 1: @Smalution I checked the region width, too. Both 'region-content' and my custom region are 940px wide (descendants of 'col-sm-12')

1
  • Have you checked the region width as well?
    – DRUPWAY
    Commented Sep 19, 2016 at 8:40

1 Answer 1

0

You can always make the image fit the container with CSS.

For example:

.block .content img {
  max-width: 100%;
  height: auto;
}

If you're using Bootstrap, you can achieve the same effect by adding the class img-responsive to the image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.