Home > Enterprise >  VS Code Editor shows preview instead of code in HTML
VS Code Editor shows preview instead of code in HTML

Time:11-24

I'm a high school student, and my class and I just started exploring the world of HTML code. Yesterday, I wrote some basic HTML code and saved it on my computer. Today, I tried to open it, and instead of seeing usual HTML code, the editor showed me a preview.

I tried :

  1. disabling extensions in VS Code
  2. opening other HTML files
  3. opening files with TextEdit and Whisk (both showed me the actual code)

screenshot of the Visual Studio Code Editor showing a preview for an HTML file

I'm probably encountering a basic problem, maybe it's not even a problem, but I honestly am lost. I don't know how to get back to my code...

CodePudding user response:

VS Code doesn't have built-in support for HTML preview, but there are extensions available in the VS Code Marketplace. Open the Extensions view (Ctrl Shift X) and search on 'live preview' or 'html preview' to see a list of available HTML preview extensions. Then deactivate those plugins.

After the completing above steps, if you are still having the same problem, please try to contact Microsoft Help Page https://learn.microsoft.com/en-us/answers/products/

CodePudding user response:

1- open your file with chrome and Right click on Page Select Show Source File and then copy that to your Vscode and then blah there it is your code.

2- change the extension of your .html file to .php and then reverse that to html when your code has showed up.

  • Related