Support » Plugin: Gutenberg » IMG width and height in image block

  • Resolved mati08

    (@mati08)


    Default Gutenberg Image block i HTML output has no height=”xxx” and width=”xxx” parameters:

    <div class="wp-block-image">
    <figure class="aligncenter size-blog-width">
    <img src="https://domain.tld/wp-content/uploads/img-640x136.jpg" alt="alt" class="wp-image-83" srcset="https://domain.tld/wp-content/uploads/img-640x136.jpg 640w, https://domain.tld/wp-content/uploads/img-300x64.jpg 300w, https://domain.tld/wp-content/uploads/img-768x163.jpg 768w, https://domain.tld/wp-content/uploads/img.jpg 814w" sizes="(max-width: 640px) 100vw, 640px">
    <figcaption>something</figcaption>
    </figure>
    </div>

    How can I force WordPress/Gutenberg to add them?

    I need them (especially height) for correctly make image placeholder in lazy-load plugin.

    The post is related to this issue: https://wordpress.org/support/topic/lazy-load-placeholders-toc-and-gutenberg-problem/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mati08

    (@mati08)

    Anyone?

    Plugin Author Jorge Costa

    (@jorgefilipecosta)

    Hi there!

    It is possible to add height and width to the images by changing the width and height value of the image on the block inspector. The values set there will appear as HTML attributes.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘IMG width and height in image block’ is closed to new replies.