Tuesday 29 December 2015

How to include css,js file on head in magento 2

First you paste your css file here :-  pub/static/frontend/{Package}/{theme}/en_US/css/ 
  your js file here :-  pub/static/frontend/{Package}/{theme}/en_US/js/

And open below directory file :-

app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml

And add your css or js file name in <head> tag :- 
<css src="css/custom.css"/>
<script src="js/custom.js"/>

No comments:

Post a Comment