Gutenberg: Images with `alignfull` and `alignwide` shouldn't be enclosed by `p`

Created on 3 Jul 2017  ·  3Comments  ·  Source: WordPress/gutenberg

A full width image with no caption is rendered like:

<p>
  <img src="..." alt="..." class="alignfull wp-block-image">
</p>

Most themes will have a full width p element, so it is nearly impossible to make the image full width, without JS or some position: * hacks.

Some possible solutions:

  • always use the figure element for alignfull and alignwide
  • use a div element with alignfull and alignwide instead of the p
  • add the alignfull and alignwide classes also to the p element.

Similar to https://github.com/WordPress/gutenberg/issues/1305

Most helpful comment

I think this is a very solid observation, and great ticket. Making images go full-width is going to be complicated already, but this would make it slightly easier for themes. 👍 👍

All 3 comments

This makes sense to me cc @jasmussen

I'd go for the figure wrapper in this case.

I think this is a very solid observation, and great ticket. Making images go full-width is going to be complicated already, but this would make it slightly easier for themes. 👍 👍

this was fast, thanks :smile:

Was this page helpful?
0 / 5 - 0 ratings