system PAUSE system PAUSE - 1 year ago 67
HTML Question

What extension should I use for files containing fragments of HTML?

The ".html" suffix on a filename implies that the document contains

, and

I have some files that each contains a
element or two, but no
tags. The file contents are well-formed HTML fragments in the sense that they could be inserted into a
tag of a compliant HTML document, and it would still be compliant. (They contain no "
<% %>
" markers, no PHP code, etc.) But a fragment file is not compliant HTML by itself, so I'd like to give it a different naming convention.

Several "file extension" sites include an entry for ".PHT" and describe it as "Partial Hypertext File." That sounds promising, but I can't find any additional explanation on the origin, expected file format, or applications that use it. Also, many of the same sites identify ".phtml" and ".phtm" (which appear to be longer versions of the .pht suffix) as PHP files — as noted, my files are not PHP files.

Should I use ".pht" as a suffix? Is there a more appropriate naming convention?

I'd like to distinguish fragment files from the full HTML documents in the same directory.

Answer Source

I would use .inc (meaning include file) or .txt.