If you want to apply css styling in a .css file that is linked to a .razor page, then I have found the best way to do this is to use the psuedo css selector ::deep:
.css
.razor
::deep
::deep .test { color: red; }