.htm和.html文件扩展名之间的区别是什么?

为什么有两个?

哪个是正确的?


当前回答

由于现在电脑广泛支持任何长度的文件类型,现在的选择只是个人的。在Windows的早期,只支持3个字母,你必须使用.htm,但现在不需要了。

其他回答

.html - DOS已经死了很长时间了。但最终并没有太大区别。

同样的事情. .根本没有区别…HTM在只有3个字母扩展名很常见的年代被使用。

我想现在有点晚了,但是唯一一次它确实有区别是当你在MS Outlook上设置HTML签名时(甚至是2010年)。它只是不能处理.html扩展,只能处理.htm

简而言之,它们完全相同。如果你注意到URL的结尾,有时你会看到。htm,有时你会看到。html。它仍然引用超文本标记语言。

简短的回答

没有。它们完全一样。

长话短说

.htm和.html是完全相同的,并且将以相同的方式工作。选择取决于个人喜好,只要你与你的文件命名一致,你就不会有任何问题。

根据web服务器的配置,其中一种文件类型将优先于另一种。这应该不是问题,因为不太可能将index.htm和index.html放在同一个文件夹中。

我们总是使用较短的.htm作为文件名,因为文件扩展名通常有3个字符长。

更多信息:http://www.sightspecific.com/~mosh/WWW_FAQ/ext.html或http://www.sightspecific.com/~mosh/WWW_FAQ/ext.htm

I think I should add this part here: There is one single slight difference between .htm and .html files. Consider a path in your server like: mydomain.example/myfolder. If you create an index.htm file inside that folder and you open that like this: mydomain.example/myfolder/, it will go crazy and spit out your files as it is in your server, but if you create an index.html file in there and open that directory in your browser, it will load that file. I tested this on my VPS and found this. Maybe you could somehow set your server to load index.htm files by default, but I guess the .html file is the default file type for browsers to open in each directory.