Visual Studio 2017禁用css格式化不必要的空格

时间:2017-11-03 11:25:36

标签: visual-studio

我在尝试格式化css代码时遇到问题。 Visual Studio在css中给了我不必要的空间

在visual studio中格式化css代码之前:

.test-parent {
}

.test-parent .test-child {
}

.test-parent .test-child .test-child-child {
}

在visual studio中格式化css代码之后:

.test-parent {
}

    .test-parent .test-child {
    }

        .test-parent .test-child .test-child-child {
        }

是否可以在Visual Studio 2017中禁用不必要的空格?

1 个答案:

答案 0 :(得分:21)

我相信这个功能被称为“分层缩进”。

您应该可以通过完成以下操作来禁用它。

  • 单击“工具”菜单
  • 点击选项...
  • 向下滚动并展开“文字编辑器”
  • 向下滚动并展开CSS
  • 选择高级
  • 将分层缩进设置为“关闭”。

这应该阻止Visual Studio以嵌套格式格式化CSS。

相关问题