Live data from Hacker News

Entire website in a single HTML file

css-tricks.com

41–50 of 333 posts

Re: Entire website in a single HTML file

#44
post #37

Earlier quoted context omitted.

MHT did this 20 years ago and got all but abandoned (probably for good reasons).

Interestingly, the support for mht/multipart is still there in Chrome and Firefox; or at least it was relatively recently. However it only works for files and not when accessing an mht file over http. The format itself is relatively simple.

Yeah it's pretty much the MIME email format as a container for a webpage.

A lot of the issues "solved" in modern frameworks could have been addressed by using this, but instead things went a different path.

Re: Entire website in a single HTML file

#45
post #21

My gut instinct is that these CSS tricks may be bad for accessibility. Does anyone know how well a screen reader would deal with it?

I was just reading it in Links 2 and it is totally readable inline. It also gets a 100 from Google Lighthouse Mobile & Desktop Accessibility checks.

Re: Entire website in a single HTML file

#48
post #41

This looks like one of those sites I made as a kid. What is the significance of this?

Nobody else is really doing this, or was doing this. But you can't tell that it's different, that's what's neat about it. It works just like a multi-page site but there's not even any JS requirement.

Re: Entire website in a single HTML file

#49
post #8

This is something I've always wanted for virtual textbooks. A single .html file with all the JS, CSS, images as inline data blobs, etc. For most physics, math, CS, etc books, this should be possible. It would make it trivial to download the book for offline use and share it with others. Other than the raster images, the entire content of these types of books would probably fit in a couple MB of text. The use of #anch…

You can even embed images with a src converted to base64.

This method even works well with the back/forward browser buttons, something that a naive show/hide JavaScript solution wouldn’t.

Post reply on HN