Add custom css file into magento 2 for all pages
will explain example to add mycustom.css file to magento 2.

Need default_head_blocks.xml in theme as per given path.

path shold be

Vendor/themename/Magento_Theme/layout/default_head_blocks.xml


Find <head> tag and place 


<css src="css/mycustom.css"/>

Add css file


app/design/frontend/{Vendor}/{theme}/web/css/styles.css

Now remove cache and deploy static content. refer previous post i have posted in MAGENTO 2 BASIC COMMANDS.

Check your console mycustom.css will be loaded.


Easy one...!!!




Experienced Magento Certified Developer with a demonstrated history of working in the information technology and services industry. Skilled in SQL, PHP, XAMPP, jQuery, and Microsoft Office. Strong engineering professional with a Master of Computer Applications

0 comments:

Post a Comment

Popular Posts

Have You Any Questins Let Us Know.

Contact Us
DENISH VACHHANI
Ahmedabad India