3

So I might be thinking of the wrong file format, but I remember as a kid opening files that looked like a Windows 98 help window:

Windows 98 help window

I thought it was an MHTML file, and it allowed me to navigate between the packaged pages. Am I thinking of the right format?

NobleUplift
  • 5,631
  • 8
  • 45
  • 87

2 Answers2

2

MHTML allows HTML with links as a standalone file, as described here. Many online tools will create one for you.

.MHT files are also single HTML files.

Winfows 98 actually used a compiled HTML file - ie a .CHM

Community
  • 1
  • 1
Mousey
  • 1,855
  • 19
  • 34
  • But I can't have multiple HTML pages with one master page, and then link between the different pages inside the MHTML? I ask because each page can have from 10 to about 100 IFrames in it and I don't want to load those all at once, even if I use fancy JavaScript to hide each 'page' until called in one HTML file. – NobleUplift Aug 13 '15 at 19:15
  • And *that's** the extension I was thinking of! But man, just the name 'Compiled HTML File' sounds gross. – NobleUplift Aug 13 '15 at 19:15
  • Honestly don't even remember what my use case was for asking this, but thanks for the answer! – NobleUplift Oct 25 '19 at 22:11
1

When I needed something similar, I created a frameset in main.htm file like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    "http://www.w3.org/TR/html4/frameset.dtd">
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
    <title>My framed webpage</title>
</head>

<frameset cols="25%,*">
    <frame src="toc.htm">
    <frame src="content.htm" name="content">
</frameset>

</html>
  • toc.htm - table of contents, a list of links referred to content.htm file by id (with list of elements <a href="content.htm#toc_0" target="content">Link Title Name</a> with ids toc_0 ... toc_n). Right frame in result file.
  • content.htm - content file with links with ids toc_0 ... toc_n you want to refer to. They might be any h* elements. Left frame in result file.

If you use Java, then Jsoup is your best friend.

<frameset> tag is deprecated HTML tag The tag is not supported in HTML5

UPD. When you have three files main.htm, toc.htm and content.htm just open a main one. Previously there was a flag in Chrome experimental features to save as a MHTL and you had only to activate it, but now seems they have removed it.
However you can use a Save as MHTML add-on instead.

DimaSan
  • 12,264
  • 11
  • 65
  • 75
  • Is the source above the `nav.htm` or the `file.htm`? How do you save those both in an MHTML file? – NobleUplift Oct 25 '19 at 22:11
  • The source above it third file `main.htm`. I have updated the answer and made links more self-explanatory so that `file.htm` is now `content.htm` and `nav.htm` is now `toc.htm`. – DimaSan Oct 25 '19 at 23:34
  • 1
    Thanks for updating your answer! I'll have to figure out my original use case and try it out. – NobleUplift Oct 29 '19 at 21:39