C#
- In the Tools Menu click Options
- Click Show all Parameters (checkbox at the bottom left) (Show all settings in VS 2010)
- Text Editor
- C#
- Formatting
- New lines
And there check when you want new lines with brackets
Css:
almost the same, but fewer options
- In the Tools Menu click Options
- Click Show all Parameters (checkbox at the bottom left) (Show all settings in VS 2010)
- Text Editor
- CSS
- Format
And than you select the formatting you want (in your case second radio button)
For Visual Studio 2015:
Tools → Options
In the sidebar, go to Text Editor → C# → Formatting → New Lines
and uncheck every checkbox in the section “New line options for braces”
For Mac OS users:
Preferences → Source Code → Code Formatting → choose what ever you want to change (like C# source code) → C# Format → Edit -→ New Lines