Link to home
Start Free TrialLog in
Avatar of JamesNewton
JamesNewton

asked on

Standard extension for a file containing an html fragment?

In other words, what do you call a file that has HTML tags in it, but only the tags that would normally appear between <BODY and </BODY. It doesn't have the <HTML <HEAD or <BODY tags?

I was thinking .INC but that is so overused and I would like that to be reserved for ASP code includes. .WAP is almost... .TXT isn't enough.

I spent about 15 minutes searching on the net and on ee specifically, but good keywords seem to be hard to come by: "html fragment" "without <head" "without <html" "html without extension" all came to nothing.

The answer will hopefully allow some sort of functionality in terms of being recognizable (e.g. starts with .H) and official (Microsoft, rfc, netscape, etc... said so).
Avatar of neester
neester
Flag of Australia image

I believe .htm is fine.
There are no "real" standards that I know of...
You could use .tpl (template)....
I would stick with .htm (as opposed to .html) - just so you can see its different, but you can also load the fragment in the browser indivicually without having a forced download (if you use .tpl - most browsers will come up with a download dialogue)...
SOLUTION
Avatar of cristy56
cristy56

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The html extension has nothing to do with whether it is a well-formed and complete document.  the content IS html.  if it is be sued as an include then .inc or .shtml is appropriate, but infact it is a text file and if you give it a .txt extension and send it to a browser, it will still be rendered as html.

Cd&
COBOLdinosaur - but the truth is - there is no real standard here.
.inc is not defined as a HTML fragment...

.txt pages with HTML code SHOULD NOT be rendered HTML.
FireFox doesn't render txt files as HTML.
I just ran a test with the source of this page.

I think James was just looking for some advice on the BEST way to go about it.
I guessed he is using a template system for a website.
And this is the method i have used.
It makes life easier - when looking through folders...

And sometimes a template doenst work, and you can easily load the HTML fragment in the browser still if its a .htm...

THanks for the Grade A James :)
BTW Cd&,
Internet Explorer will not render a .txt with HTML inside it as HTML either.
I just tested it too...