Why is my code not working html

I am learning how to use a text editor, and I've just created my first file with it. It previews with the correct output, but when I run it in the browser, it gives me a blank page.

As you can see, the doctype and html tags are in place, as well as the head and body. I am using Visual Studio Code as my text editor. Why will this not display anything in my browser? To be clear, it does preview, just won't display in browser




  Hello World


  

Hello World

mplungjan

159k27 gold badges167 silver badges225 bronze badges

asked Nov 15, 2020 at 21:10

Why is my code not working html

4

Are you sure? It does display on mine. Is the file saved as a .html file? Also, try opening it on another browser. If that doesn't work, try creating a new file in Notepad or something similar, save it with a .html file extension and try opening it again.

EDIT: Try using Notepad. Check if the file is saved with a UTF-8 encoding.

Why is my code not working html
If that doesn't work, try installing another browser or using Edge/Safari/Internet Explorer or whatever built-in browser you have.

answered Nov 15, 2020 at 22:21

Why is my code not working html

1

In case someone is still struggling with this, try saving your files before you open them. That fixed the problem for me.

answered Oct 7, 2021 at 8:22

It loaded on Fire Fox, just not on Google Chrome for some reason. I'm sorry for wasting everyone's time. As I have said, I am unfamiliar with VS Code. Thank you for all of your suggestions.

answered Nov 17, 2020 at 0:36

Why is my code not working html

2

I had this same baffling problem. I quit Chrome, re-opened, and then I was able to open my .html files (from my Mac's Finder) with Chrome just like I could already open them with Safari or other browsers.

answered May 12, 2021 at 16:00

Why is my code not working html

Possible Reasons:

  • You might not have saved the changes after writing the code (most likely).
  • Problem with the browser (load it in another browser)
  • Check the extension (just for clarification)

There is no problem with !DOCTYPE html tag or html tag.

K450

6124 silver badges16 bronze badges

answered Dec 28, 2021 at 7:58

In visual studio code just type in a blank page

html:5

then just press the touch "tab", it will display a basic html 5 structure to start

answered Nov 15, 2020 at 21:23

bfalsatabfalsata

711 silver badge4 bronze badges

1

Just remove "" a the second line it's already set in the first line



  Hello World


  

Hello World

answered Nov 15, 2020 at 21:19

bfalsatabfalsata

711 silver badge4 bronze badges

2

Not the answer you're looking for? Browse other questions tagged html visual-studio-code or ask your own question.

Why HTML code is not working?

Possible Reasons: You might not have saved the changes after writing the code (most likely). Problem with the browser (load it in another browser) Check the extension (just for clarification)

What to do when code is not working?

7 tips for getting unstuck when programming.
Don't panic. First things first: don't panic. ... .
Read the error. Take the time to read the error you received. ... .
Check your spelling. ... .
Verbalize the problem. ... .
Break down the problem. ... .
Google it. ... .
Tap into programming resources..

How do I activate HTML code?

HTML Editors.
Step 1: Open Notepad (PC) Windows 8 or later: ... .
Step 1: Open TextEdit (Mac) Open Finder > Applications > TextEdit. ... .
Step 2: Write Some HTML. Write or copy the following HTML code into Notepad: ... .
Step 3: Save the HTML Page. Save the file on your computer. ... .
Step 4: View the HTML Page in Your Browser..

Why is my HTML code showing up as text?

This HTML isn't being interpreted as plain text: it's being interpreted as HTML. It's just that the contents of your HTML include markup that has been escaped, such as < and > .