How to open an HTML page in the browser with Vscode

Asked

Viewed 2,291 times

0

I need to open a page in the browser with my HTML codes, using Vscode. However, when I do F1+tasks: Configure Tasks, it does not open tasks.json.

1 answer

1

You can install some extension as for example Live HTML Previewer

Extension link: https://marketplace.visualstudio.com/items?itemName=hdg.live-html-previewer

With it installed you can configure a shortcut to Open inBrowser, thus vc will be able to open your HTML file directly in the Browser. In my case set the shortcut as picture Ctrl + Q + W

inserir a descrição da imagem aqui

OBS: You need to be in an HTML file, you can also click with the botão da direito and have it opened in the browser

inserir a descrição da imagem aqui


Option 2

Install the Live Server, with it you can click on Go Live, or click with the btn da direita and have it opened in Browser

Extension link: https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer

OBS: To work you must put the entire project folder inside VS Code, if you have an insolated file alone in VS Code GO Live won’t work!

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.