Opened 3 years ago
Closed 5 months ago
#52828 closed defect (bug) (wontfix)
Twenty Twenty-One: Custom HTML Block Doesn't Align in Content
Reported by: | mrjarbenne | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.6 |
Component: | Bundled Theme | Keywords: | close |
Focuses: | css, template | Cc: |
Description
The Custom HTML block doesn't align to the content section of the theme, having no left margin.
Using the core Custom HTML block to add an iframe embed code seems to be missing the <figure> div that would centre the content within the body of the post, resulting in the embedded object to be aligned to the far left margin.
This doesn’t affect the editor, but does rear its head in the published post.
Steps to reproduce:
Add a Custom HTML Block to a new post
Paste an iFrame embed code in the resulting Field
Publish Post.
Here's a link to an example: https://hwdsb.staging.boreal321.com/2021/03/12/test-embed/
It's also an issue with the version of 2021 running on wordpress.com: https://mrjarbenne.wordpress.com/2021/03/16/test/
Change History (5)
#2
@
3 years ago
Thanks @poena for the quick response. This behaviour is a change from the other bundled themes, which continue to contain any block -- including the Custom HTML block -- within the entry-content div. Wouldn't adding additional HTML in that block, when other themes don't require it, break the display if users were to switch to an alternate theme (Twenty-Nineteen for example).
If additional HTML is required, is it possible that the preview within the editor should reflect that? Currently the editor behaves in a similar fashion to the other bundled themes, displaying the content within the established margins:
Hi,
this is not a bug, but intended.
This is a block designed to contain your own custom HTML. Adding a wrapper to the block in the theme might break the users HTML code.
If you do not want the block contents to be unstyled you need to add your own HTML to reflect that.