I want to use a static css to reset my theme css, i cant modify main files because its paid theme and it will be auto reset at time of update.

So I need to add a static css just before (head close) so it could reset all top css.

I know how to add by : default_head_blocks.xml but that is adding css at the top of .

i want to use it like this js example:

 <referenceContainer name="before.body.end">
      <block class="Magento\Framework\View\Element\Js\Components" name="js.beforebody" as="jsbeforebody" template="Magento_Theme::js/js.phtml"/>

1 Answer 1


I deal this case like this: Write your custom CSS in a custom.css -file and load this file normally in the head.

All classes you want to override can be overwritten on this way:


.class {
color: red

the !important -element is overwriting an existing definition.


.class {
color: blue !important;


body div.class {
color: blue;

The more specific you call the css the higher the chance to overwrite.

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.