The ".html" suffix on a filename implies that the document contains html
, head
, and body
tags.
I have some files that each contains a div
element or two, but no html
or body
tags. The file contents are well-formed HTML fragments in the sense that they could be inserted into a body
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?
Edit: I'd like to distinguish fragment files from the full HTML documents in the same directory.
An HTML file is nothing more than plain ASCII text, but all HTML files must have a special file extension for web browsers to recognize them. This extension is either . htm OR . html.
To create a new HTML Fragment:Click on the New HTML Fragment button at the top of the screen. In the Description box enter something descriptive so that you know what the HTML code is for or what it does. This is just for your reference and will not appear on your site. Paste your HTML code into the large HTML Code ...
I would use .inc
(meaning include file) or .txt
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With