The VSCode team has developed a Live Server extension with a lot of integrations. See v1.58 pre-release notes:
Live Preview
We have developed a Live Preview extension, which hosts a local server for web development previewing!
It features an in-editor browser preview, live preview refreshing (on file change or on save), multi-root support, and more!
The extension also has a
Live Previewtask, which runs a persistent server and allows you to view server traffic and its associated files.
To learn more about what it can do, view it in the marketplace or check out its repo.
Answer from Mark on Stack Overflow
Can anyone reccomend an extenstion for previewing HTML that can show images?
If I view my webpage in chrome/a browser it shows everything correctly, but none of the VSCode preview extentions can show images. If I use <img src=> then it's a broken image link, and if I use URL("") then it just doesn't show at all.
So I know my code is correct, but is there something else I'm missing about getting the preview extentions to display images from within VSCode?
How to view an HTML file in the browser with Visual Studio Code - Stack Overflow
Preview using visual studio code shows file contents instead of webpage preview as described in tutorial.
VS Code HTML and CSS preview not linking
VS Code is not showing my html code rather it is just rendering it in preview mode
Videos
The VSCode team has developed a Live Server extension with a lot of integrations. See v1.58 pre-release notes:
Live Preview
We have developed a Live Preview extension, which hosts a local server for web development previewing!
It features an in-editor browser preview, live preview refreshing (on file change or on save), multi-root support, and more!
The extension also has a
Live Previewtask, which runs a persistent server and allows you to view server traffic and its associated files.
To learn more about what it can do, view it in the marketplace or check out its repo.
There are tons of different vscode extensions for browser previews. The one i'm using is Browser Preview.

To view .php files, you need a server, like Apache.
XAMPP is an all in one solution which offers MySQL, Apache and some other tools: https://www.apachefriends.org/index.html
For Windows - Open your Default Browser - Tested on VS Code v 1.1.0
Answer to both opening a specific file (name is hard-coded) OR opening ANY other file.
Steps:
Use ctrl + shift + p (or F1) to open the Command Palette.
Type in
Tasks: Configure Taskor on older versionsConfigure Task Runner. Selecting it will open the tasks.json file. Delete the script displayed and replace it by the following:{ "version": "0.1.0", "command": "explorer", "windows": { "command": "explorer.exe" }, "args": ["test.html"] }Remember to change the "args" section of the tasks.json file to the name of your file. This will always open that specific file when you hit F5.
You may also set the this to open whichever file you have open at the time by using
["${file}"]as the value for "args". Note that the$goes outside the{...}, so["{$file}"]is incorrect.Save the file.
Switch back to your html file (in this example it's "text.html"), and press ctrl + shift + b to view your page in your Web Browser.

VS Code has a Live Server Extension that supports one click launch from status bar.
Some of the features:
- One Click Launch from Status Bar
- Live Reload
- Support for Chrome Debugging Attachment

So Im editing an HTML file and Im using microsoft preview extension inside VS CODE.
Now problem is, I cannot right click on the html preview and jump to that part of code on the left sidebar.
Is there an option to get this done ?
Because now I have to search through the code up and down and it wastes a lot of time.


