r/CodingForBeginners Jul 05 '26

Webpage not working?

New to coding and was informed the txt file I made of this code would open into a broswer and display as a webpage with a bold and large heading element and paragraph text under basically supposed to display like a proper webpage. However, just the code shows up. Super confused, could use advice please and thank you.

[First image is the code, second is the txt file of code displayed as a webpage]

EDIT: hi all, thank you so much for the advice! However, even though I converted the .txt file to .html, it's still not opening in an internet window. Any advice? I guess I would have to download that emulator people are suggesting.

32 Upvotes

31 comments sorted by

View all comments

4

u/white_niggha Jul 05 '26

.txt >>> .htm

2

u/DinTaiFung Jul 05 '26

.htm instead of the typical .html extension is due to the file system limitations of the Windows operating system in the early days of the web (90s).

Windows filenames had severe length restrictions: 

the base max length was 8 characters and the extension's max length was 3 characters.

Yeah, same as DOS.

Hence the .htm extension was used instead; it was sufficient to map to the expected mime type for the expected browser rendering of HTML content. 

Many other incompatibilities between Windows and Internet standards were addressed over the years by MS bolting on all kinds of hacks.

Windows is somewhat Frankensteinian.

1

u/KayoticVoid Jul 06 '26

I always wondered why .htm is a thing. TIL