作者:乔志造型店长阿杰 | 来源:互联网 | 2023-01-10 13:10
我尝试格式化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> James..:
我相信这个功能叫做"Hierarchical Indentation".
您应该可以通过完成以下操作来禁用它.
单击"工具"菜单
单击选项...
向下滚动并展开"文本编辑器"
向下滚动并展开CSS
选择高级
将分层缩进设置为"关".
这应该阻止Visual Studio以嵌套格式格式化CSS.