简体   繁体   English

我无法在 Visual Studio Code 中设置基本 HTML 模板

[英]I Cant set a basic HTML template in Visual Studio Code

so im new in the coding world, i became interested when i had coding classes, last week.所以我是编码界的新手,上周我在上编码课时开始感兴趣。 In one of them we used Visual Studio Code and i liked the app, it looked relatively easy.在其中一个中,我们使用了 Visual Studio Code,我喜欢这个应用程序,它看起来相对简单。 But i have some problem with the Emmet,the weird part is that it only doesnt work when im trying to set a basic HTML template using "!".但是我对 Emmet 有一些问题,奇怪的部分是它仅在我尝试使用“!”设置基本 HTML 模板时不起作用。 I already tried the settings and the emmet is activated and already tried to edit the setting.json and copied a couple of codes from the internet.我已经尝试了设置,并且激活了 emmet,并且已经尝试编辑 setting.json 并从互联网上复制了一些代码。 Nothing seems to work.似乎没有任何效果。 Could someone help me?有人可以帮助我吗?

This worked for me:这对我有用:

  1. Open the VSCode settings, search for 'emmet' and scroll down to the 'Emmet: Trigger Expansion on Tab' setting, see VSCode Emmet Settings .打开 VSCode 设置,搜索“emmet”并向下滚动到“Emmet:在选项卡上触发扩展”设置,请参阅VSCode Emmet 设置 Make sure it's checked, then close the settings.确保已选中,然后关闭设置。
  2. Create a new file (⌘ N)创建一个新文件(⌘ N)
  3. It should say 'Select a language' at the top它应该在顶部显示“选择一种语言”
  4. Choose HTML选择 HTML
  5. Type !输入!
  6. Press Tab and Emmet should expand it to a basic HTML5 document like按 T​​ab 和 Emmet 应该将其扩展为基本的 HTML5 文档,例如

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> </body> </html>

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

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