I have a block with a visual menu in it and I want to show up centered on the page. This is my css within the block:

margin: 0 auto;

I've also tried to put the widget when inserted into the page inside a centered div:

<div style="text-align: center;" >
{{widget type="Magento\Cms\Block\Widget\Block" template="widget/static_block/default.phtml" block_id="38" type_name="CMS Static Block"}}

What else can I do to center it?

1 Answer 1


What about if you create a new template file


And put markup to center content within this. Obviously depends on the content of template file as to whether this works

  • I'm not sure how to do that, could you put a link to instructions for this? Thanks May 24, 2019 at 15:13

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.