Search code examples
htmleditor

VS Code Editor shows preview instead of code in HTML


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...


Solution

  • 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/