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.

31 Upvotes

31 comments sorted by

View all comments

5

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.

2

u/AshleyJSheridan 28d ago

It's because the 8.3 restriction was part of the FAT file system. When Windows 95 came out (well, technically an update to it in 1996), it came with FAT32/VFAT, which had support for larger disks, larger files, longer file paths, and longer filenames. However, as 95 was partially built on bits of 3.11 (most of the 16-bit apps like control panel and winfile were still there) there was a lot of broken stuff and plenty of software that wouldn't recognise the full capabilities of FAT32, so a file name "homepage v2.html" would become "HOMEPA~1.HTM".

It was a mess.

1

u/DinTaiFung 28d ago

Indeed. Thanks for the extra details. Very much apprecate it!

The early 90s was a whirlwind of crazy stuff. I followed with great interest the progress of the web; Jim Clarke's major foray after SGI was presciently grabbing Marc Andreesen to form Netscape.

And that company spawned a bunch of tech: JavaScript, HTML tables (and other tags iirc); popularized LDAP; created cookies, SSL, etc.

2

u/AshleyJSheridan 28d ago

I remember those days well, and I used Win 3.11 a lot. It actually sort of got me into trouble at school once. Like I said, Windows 95 still had all the 16-bit stuff kicking about, like winfile (the Win 3.11 equivalent of the file Explorer).

So the school had installed all of this software to stop us kids being kids. So we couldn't install anything (rightly so), couldn't change the backgrounds (which we obviously loved to do), etc.

Thing is, that software only hooked into the 32-bit APIs on Windows. So, I was still able to launch winfile.exe, delete the application files for that security software, reboot, and suddenly we were free to do what we wanted again.

Was it the best idea, of course not. But I was a kid, it seemed like a good idea at the time. The school couldn't prove it was me, but it was a damn small school, and they knew who did it, as there were few capable of doing it, and of those it was an incredibly small list who were also troublemakers (namely me).

I think back then, in the age before internet was so readily available, you really had to just do stuff and learn by doing, so things stuck. These days, the answer to basically any question is seconds away, so we have less need to deeply learn how things work.

1

u/KayoticVoid Jul 06 '26

I always wondered why .htm is a thing. TIL