DIV block creation in magento using xml layout

0
64
create_html_div_magento2

How to add a new container to a layout (extending Magento Blank)

You need to have at least one child block with output in order to have the container rendered.

Example:


<container name="mike.container" as="mikeContainer" label="Mike Container" htmlTag="div" htmlClass="mike-container">
    <block class="Magento\Framework\View\Element\Text" name="testtextblock">
        <arguments>
            <argument name="text" xsi:type="string"><![CDATA[<!-- -->]]></argument>
           </arguments>
    </block>
</container>