Add custom css file into Magento 2 for all pages
Add custom css file into Magento 2 for all pages – Today, I will explain example to add mycustom.css file to Magento 2.
Need default_head_blocks.xml in theme as per given path. Your directory path should be as per given example.
Vendor/themename/Magento_Theme/layout/default_head_blocks.xml
Find tag and place below code –
<css src=\"css/mycustom.css\"/>
Add css file in below path –
app/design/frontend/{Vendor}/{theme}/web/css/styles.css
Now remove cache and deploy static content.
Check your console mycustom.css will be loaded.
Easy one…!!! Thank You.!