Magento version: 2.0.0
How to add a class of style into tag? I think it is added in the xml, right?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
Yes it's done via XML I reckon you can use the attribute tag for this
So in your layout, you can do:
<body> <attribute name="class" value="my-body-class" /> <attribute name="id" value="my-html-id"/> ..... </body>
An example in the default Magento install can be found here: https://github.com/magento/magento2/blob/2.0.0/app/code/Magento/Customer/view/frontend/layout/customer_account.xml
In case you want to add a dynamic variable, eg. Store Code to the body class, you can take a look at the following example I made: https://github.com/samgranger/StoreCodeBodyClass