
You should create main.css in a path relative to templating directory.
The problem is source is not the thing you are probably after. look at the template below:
Twig
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" {{ source('main.css') }}">
</head>
<body>
This is Body
</body>
</html>
the produced HTML source in browser is this:
HTML Source
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" body{ background: red;}">
</head>
<body>
This is Body
</body>
</html>
You are probably after asset twig function:
<link type="text/css" rel="stylesheet" {{ asset('main.css') }}">
Please note that, asset gets path relative to public directory, so you should put your web assets inside public, not templating.
If you are using Symfony 4, you should also install symfony/asset:
composer require symfony/asset
You may read more on this here: Creating and Using Templates, Linking to Assets
main.cssshould be underpublicdir i guess