One of the most common tasks a fronted developer will How to add a Custom CSS File in Magento2
In this Tutorial you’ll learn step-by-step instruction on How to add a Custom CSS File in Magento2.
In Magento2, the Syntax to add style sheet is different, as well as the files added a different location in Magento2
If You have to add Custom css. You have to Open default_head_blocks.xml file. This File is Located in
Open default_head_blocks.xml then add the CSS file in Layout Configuration.
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/framework/Module/etc/module.xsd">
<css src="css/custom.css" />
The CSS File is Located in
Magento2 use css Files from pub/static . Clear the Original static Files within the pub/static and run this Command
php bin/magento setup:static-content:deploy
if You refresh your magento Store, You should be able to see your css file is being included in Magento Fronted.
Hope this Helps