简体   繁体   English

如何使用 Visual Studio Code 格式化 HTML?

[英]How can format HTML with Visual Studio Code?

I found a file that I want to read with an unorder HTML code,我找到了一个我想用无序 HTML 代码读取的文件,

There is any visual studio code extension that can fix it to order code?是否有任何 visual studio 代码扩展可以将其修复为订购代码?

The code is something like and I want it to look prettier that each tag breaks the line.代码是这样的,我希望它看起来更漂亮,因为每个标签都打破了这一行。

div><div class="menu"><div class="grid grid-flow-col self-center mx-auto"><div class="cursor-pointer font-bold mx-4"><a href="#ava"><p>text</p></a></div><div class="cursor-pointer font-bold mx-4"><a href="#jarvis"><p>home</p></a></div><div class="cursor-pointer font-bold mx-4"><a href="#faq"><p>FAQ</p></a></div><div 

You should be able to format, or "beautify" the code in the Visual Studio Code editor using the following:您应该能够使用以下代码在 Visual Studio Code 编辑器中格式化或“美化”代码:

Windows: Shift + Alt + F Linux: Alt + Shift + I macOS: + + F Windows: Shift + Alt + F Linux: Alt + Shift + I macOS: + + F

Alternatively Right click somewhere in the content area (text) for the file Select "Format Document" from the menu.或者从菜单中右键单击文件 Select 的内容区域(文本)中的某处“格式文档”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM