Why css files are opening in safari by default in MacBook?
I don't know why it's happening, but the usual way to correct would be:


Select a CSS file
Press Cmd-I, or right-click and select "Get Info"
In the Information popup, locate the "Open With" dropdown, and select the application you want to open CSS files with. 
To affect all CSS files, instead of just this one, click the "Change All..." button immediately below the "Open With" dropdown.


If that doesn't work, it can indicate a problem with the Launch Services Database, or some other corruption of a system cache or database which is probably fixable. But try that first.