You’ll learn in this article how to create a file in for Visual Studio Code editor, and how to open the file on a browser.
Features of vs code editor:
The Visual Studio Code editor is considered one of the best editors for learning programming. It supports many programming languages, including Python, PHP, JavaScript, C++, C#, Java, and many other languages. It also has some add-ons that you can use while you are learning programming or even while you are working.
how to create folder in vs code:
1- Open the editor, then go to file, then open folder, as shown in the image below.
2- We create a new folder by going to new then folder, as shown in the image below.
3- We name the folder with the name of our project, as shown in the image below.
4- Go to the folder we created, then click on select folder, as shown in the image below.
how to create html file in visual studio code:
1- Go to file, then new text file, as shown in the image below.
2- After creating the file, we notice that it does not have any extension, as shown in the course below.
3- To give the file a name, go to file, then save, as shown in the image below.
4- After clicking on save, a window will pop up to name the file. We give the file a name, for example: index. Then we add the language extension that we will work with, i.e. html. Then we click on save, as shown in the image below.
5- Once you give the file name and extension, the file will be recognized, as shown in the image below.
How To Create a file directly on the text editor:
If we look at the sidebar in the text editor, we notice the possibility of creating a folder or file. We create a file, give the file a name, and then the language extension we are working with, as shown in the image below.
How to open HTML file in browser:
1- After writing to the file, we go to file, then save, or save all if we wrote or modified several files, as shown in the image below.
2- We go to our project folder, then we choose the file that we want to display on the browser, we right-click on it, then choose open with, then the browser that we will use, as shown in the image below.
3- We notice in the image below that the file was successfully displayed on the browser.
Here we have finished. We will see you in the next lesson
Thank you for reading the article and do not forget to share it with friends