CSS编辑器,在编辑时扩展一行声明 [英] CSS editor which expands one-line declarations on editing
本文介绍了CSS编辑器,在编辑时扩展一行声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有一个CSS编辑器自动扩展单行声明作为焦点上的多行声明?要澄清我的想法,请参阅以下示例:
Is there a CSS editor which automatically expands one-line declarations as multi-line declarations on focus ? To clarify my thought, see example below:
原始CSS:
div#main { color: orange; margin: 1em 0; border: 1px solid black; }
但是当关注它时,编辑器会自动将其扩展为:
But when focusing on it, editor automatically expands it to:
div#main {
color: orange;
margin: 1em 0;
border: 1px solid black;
}
当它失去焦点时,编辑器会自动将其压缩为一行声明。
And when it looses focus, editor again it automatically compresses it to one-line declaration.
感谢。
推荐答案
你应该能够做一个接近的近似:
If you are using Visual Studio you should be able to do a close approximation of this:
- 你可以通过工具 - >改变CSS的格式化
- 转到文本编辑器 - > CSS - >格式化,然后选择半自动 ctrl + A , ctrl + K , ctrl + D 重新格式化。
- You can change how CSS is formatted via the Tools -> Options menu.
- Check 'Show all settings' if it is unchecked.
- Go to Text Editor -> CSS -> Format and pick the semi-expanded option
- Ok you changes.
- Then ctrl+A, ctrl+K, ctrl+D should re-format your document
- When you are finished editing just go back to the options and pick the compact CSS format then ctrl+A,ctrl+K,ctrl+D to re-format again.
希望这有助于。
这篇关于CSS编辑器,在编辑时扩展一行声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文