Home > database >  Why is my HTML code not translating right to the browser?
Why is my HTML code not translating right to the browser?

Time:12-07

When I type my code in VSCode, it ends up looking like below in Google Chrome. Why would it be doing that? 1

I tried fixing my code and I expected it to come out looking cleaner in the browser. It actually just brought over all of the code.

CodePudding user response:

When loading local files, browsers use the file extension to determine how to process the file.

Since your file doesn't have one, it treats it as plain text.

Rename it so it ends in .html.

CodePudding user response:

From the URL, it is clear that you've not saved your file with .html extension. That is why it is showing up as text instead of a web page.

Save the file with name Mywebsite.html and try again. Hope this helps!

  •  Tags:  
  • html
  • Related