简体   繁体   中英

Cannot start editting my Html file in Visual Studio Code

I create a file with html extension with visual studio code. I can create the file but I cannot edit it. Can you help me solve this issue

Try running Visual Studio Code as an administrator if you are using Windows.

Right Click Visual Studio Code > Run as Administrator, follow the instructions from then on.

You can also edit file permissions entering here:

Right Click File > Properties > Security tab

This should lead you to an User Selection screen, select your user and click Edit, see if the checkmarks for Write and Read are activated, activate them otherwise, click OK and restart Visual Studio Code, try to access the file then.

If you are using Linux, try changing the read and write permissions so that you can make modifications to the file. This is done through chmod. Use Bash (or the terminal emulator you are given for doing this).

Example:

chmod +rw <file_here>

That should be enough.

html extension with visual studio code it have a lot of problems, so you can create index.html by yourself. Example:

  1. Open VS then press on File then click on new window.
  2. You can save as this window in your project folder.
  3. Don't forgot to save it with.html file type so browser and VS can read it.

More description would be better...Don't understand " create a file with html extension". Try to create a.txt file and open it with vscode and see if you can edit it. If can, you can create another.txt file in your PC, change the suffix of the filename(.txt) to (.html) and then try to open it with vscode, check if you can edit it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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