While I'm saving the static block extra div's are adding to static block. How to avoid the divs in Magento 2.3?

<div data-content-type="row" data-appearance="contained" data-element="main"><div data-enable-parallax="0" data-parallax-speed="0.5" data-background-images="{}" data-element="inner" style="justify-content: flex-start; display: flex; flex-direction: column; background-position: left top; background-size: cover; background-repeat: no-repeat; background-attachment: scroll; border-style: none; border-width: 1px; border-radius: 0px; margin: 0px; padding: 0px;"><div data-content-type="html" data-appearance="default" data-element="main" style="border-style: none; border-width: 1px; border-radius: 0px; margin: 0px; padding: 0px;" data-decoded="true">

I don't have the custom style enabled, and I just have HTML code in my custom block.

Magento 2 Page Builder CMS blocks

Magento 2 Page Builder CMS blocks

  • Did you get any solution? Please provide fix if you have Jul 8 '21 at 12:41

Unfortunately, u cannot remove those divs that row is injected by magento and it's mandatory to have a row when creating contents using page builder. If its creating an issue with UI e.g it's not showing full width then try using the other Appearance like full-width or full-bleed on Row-level Setting.

there is one issue wherein it applies flex which breaks the UI in some cases. for this, u can apply a class or custom class that uses block.

  • This extra Div is very useless in case of CMS Blocks where you need small piece of html to be placed in some area. It's frustrating. Jul 8 '21 at 12:41

A quick and dirty trick would be to identify the css selector for the elements you would like to overwrite styles. For example I just needed to get rid of the padding and margin, so I added the below css snippet in the Page Builder content area (in the admin) right at the beginning.

/* overwrite parallax styles */
div.main div div { padding: 0 !important; margin: 0 !important; }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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