Prevent indenting when formatting CSS

In Visual Studio 2013, when I format my CSS code ( Ctrl + K + F ), sometimes my CSS properties are inserted into the hierarchy.

For example:

.a { color:red; } .a .b {color:blue; } 

becomes:

 .a { color:red; } .a .b { color:blue; } 

When I would prefer:

 .a { color:red; } .a .b { color:blue; } 

Is there a way to modify Visual Studio to prevent this indentation?

+16
css visual-studio visual-studio-2013
source share
1 answer

Yes, you can set this preference in the "Tools", "Options" menu.

Collapse in the Text Editor to CSS , and under Advanced turn off the Hierarchical Indentation :

enter image description here

+37
source share

All Articles