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
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.
answered Nov 15, 2020 at 22:21
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
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
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