格式化CSS时防止缩进

Cur*_*urt 24 css visual-studio visual-studio-2013

在Visual Studio 2013中,当我格式化CSS代码(Ctrl+ K+ F)时,它有时会将我的CSS属性缩进到层次结构中.

例如:

.a {颜色:红色; } .b.*{color:blue; }

变为:

.a { color:red; }
.a .b {color:blue; }
Run Code Online (Sandbox Code Playgroud)

当我更喜欢:

.a {
  color:red;
}

   .a .b {
     color:blue;
   }
Run Code Online (Sandbox Code Playgroud)

有没有办法修改Visual Studio以防止这种缩进?

Reg*_*dit 46

是的,您可以从"工具","选项"菜单中为此设置首选项.

向下钻取在Text EditorCSS和下Advanced,转Hierarchical Indentation关:

在此输入图像描述