I just started in VSCode and I’m trying to make a website. I have a basic HTML code and when I run it, it displays the code that I have into a tab in Chrome instead of what the actual website would be like.my code before runningwhat displays after running
I tried creating a new file, uninstalling and reinstalling VSCode, and it still doesn’t work.
<html>
<body>
<h1>The Template Element</h1>
<p>Click the button below to display the hidden content from the template element.</p>
<button onclick = "showContent()"> Button</button>
<h2>Flower</h2>
<img src = "images/Cello Wallpapers - Wallpaper Cave.jpg" width = "214" height ="204">
</body>
</html>
>Solution :
Name your file with a .html file extension. Otherwise, the browser doesn’t really know the type of file you want it to open and treats it like text.