vscode 似乎缺少格式设置。 我希望能够格式化 html,以便我的 html 显示为:
<div attrib1=value1
attrib2=value2
attrib3=value3>
Content
</div>
这是我非常想拥有的一项功能!
最佳答案
VSCode 现在添加了一种方法来执行此操作。
您可以编辑您的 settings.json
(ctrl+shift+p),然后添加以下内容以获得所需的效果:
"html.format.wrapAttributes": "force-aligned"
--或--
"html.format.wrapAttributes": "force"
force-aligned 还会添加缩进以使其与打开标签的行上的属性对齐。
访问 this link了解更多详情或更新。
关于html - 在 Visual Studio Code 中格式化 html 代码,使属性位于不同的行上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33560205/