如何在Visual Studio Code中格式化HTML [英] How to format HTML in Visual Studio Code

查看:96
本文介绍了如何在Visual Studio Code中格式化HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试过:

  • ALT + SHIFT + F
  • CTRL + K CTRL + D
  • CTRL + K CTRL + F
  • ALT + SHIFT + F
  • CTRL + K, CTRL + D
  • CTRL + K, CTRL + F

此外,当我通过 CTRL + SHIFT + P 搜索格式时,没有搜索结果.

Also when I search for format via CTRL + SHIFT + P, there are no search results.

推荐答案

在Windows上,VSCode中可以通过快捷方式 Shift + Alt + 来实现代码格式设置.F .

On Windows, code formatting is available in VSCode through the shortcut Shift + Alt + F.

在Mac上,可以通过快捷键 Shift + Option + F 使用.

On Mac, it is available through the shortcut Shift + Option + F.

在Ubuntu上,它是 Ctrl + Shift + i .

On Ubuntu, it's Ctrl + Shift + i.

注意:在屏幕的右下角,它将显示文本文件形式.也许是纯文本,PHP,HTML等.如果单击此按钮,则可以在发布上述快捷方式之前切换文件的格式.

Note: in the bottom right of the screen, it will show the text file form. Maybe plain text, PHP, HTML etc. If you click this you can switch the format of the file before issuing the above shortcuts.

这篇关于如何在Visual Studio Code中格式化HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆