how can i add custom css file for
Hello @uir347gmai8039
To add a custom CSS file in Magento 2.4, you can follow these steps:
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="css/custom.css" /> </head> </page>
php bin/magento cache:clean
With these steps, you have successfully added a custom CSS file in Magento 2.4, and it will be loaded on your storefront, allowing you to apply custom styles to your theme.
If you find our reply helpful, please give us kudos.
A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.
WebDesk Solution Support Team
Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789
Thank You,
WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789
Location: 150 King St. W. Toronto, ON M5H 1J9
Please watch this video How to add the JS and CSS files into a custom module in Magento 2 https://www.youtube.com/watch?v=JGli227W1ks, it will help you to complete your requirements.