In magento 2 Frontend developer guide, I have read that :
Certain attributes, like htmlClass, htmlId, label attributes can be changed in extending layouts
I want to change htmlClass of the container defined in 1column.xml. Could you tell me how to do it by referenceContainer or another way ?
I used : (both html_class & htmlClass)
<arguments>
<argument name="html_class" xsi:type="string">sm-page-header</argument>
</arguments>
but not affected
Thanks!
If a container is declared in xml with the following code:
<container name="my.container" htmlTag="div" htmlClass="old-class">
<...>
</container>
You can simply override the css-class by placing the following code somewhere in your extending layout files:
<referenceContainer name="my.container" htmlClass="new-class" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With