html - 像这样评论标签

我想知道这个评论标签的快捷方式是什么(macOS上的VS Code):

<!-- //////////////////////////////////////////////////////////////////////////////////////////////
                             START SECTION 3 - THE CAMPANIES SECTION  
//////////////////////////////////////////////////////////////////////////////////////////////////// -->

回答1

您可以使用“control + /”它会注释掉任何选定的行。如果你想要这样的东西,你也必须自己写你的评论设计“///////////////////////////////////////////////////////////////// " 然后你必须在选择它后在这一行上按 ctrl+/。

回答2

选择您要评论的代码部分并按照方法:

切换评论块,如下所示:

Windows:SHIFT + ALT + A

Mac:Shift + Option + A

/* a line of code
   another line of code */

另一种评论方式如下所示:

  • 注释:

    Windows:Ctrl + K + C

    Mac:Command + K + C

  • 取消注释:

    Windows:Ctrl + K + U

    Mac:Command + K + U

// a line of code
// another line of code

文档:https://vscode.one/comment-vscode/

相似文章

随机推荐

最新文章