Is there a way for me to remove the class name 'page-main' from the 'maincontent' div and add a new class name?

1 Answer 1


If you're interested, the answer is to use a referenceContainer in the XML file and add the new Class / ID names to the DIV / XML container.

For example:

<referenceContainer name="main.content" htmlTag="main" htmlId="add-ID-name-to-container" htmlClass="new-class-name"/>

The rendered DIV (main) will look like:

<main id="add-ID-name-to-container" class="new-class-name" >



The un-edited/updated version would look like:

<main id="maincontent" class="page-main" >


  • Which arguments should be used to replace the store_switcher's class ? There's a block for it, but I couldn't find any container.
    – DevonDahon
    Commented Nov 3, 2017 at 5:04
  • perfect answer made my day!!! +1 :) Commented Jun 21, 2019 at 5:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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