.htm vs .html [英] .htm vs .html

查看:127
本文介绍了.htm vs .html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该为我的HTML文件选择哪种扩展名?为什么?

解决方案

简短的解答

没有。他们是完全一样的。



长答案

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



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



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

〜mosh / WWW_FAQ / ext.htmlrel =nofollow noreferrer> http://www.sightspecific.com/~mosh/WWW_FAQ/ext.html 或 http://www.sightspecific.com/~mosh/WWW_FAQ/ext.htm



我想我应该在这里添加这个部分:

i猜测有一个单一的轻微差异btw .html和.html文件!如果您在该文件夹内创建了一个 index.htm 文件,并且以如下方式打开,请考虑您的服务器中的路径: mydomain.com/myfolder mydomain。 com / myfolder / ,它会变得疯狂并将你的文件拆分为你的服务器,

,但如果您在那里创建 index.html 文件并在浏览器中打开该目录,则会加载该文件
i在我的vps上测试了这一点,我最终得到了这个答案
,但也许你可以设置你的服务器来加载index.htm文件作为默认值。但我想.html文件是浏览器在每个目录中打开的绝对默认文件类型!


Which extension should I choose for my HTML files and why?

解决方案

The short answer

There is none. They are exactly the same.

The long answer

Both .htm and .html are exactly the same and will work in the same way. The choice is down to personal preference, providing you’re consistent with your file naming you won’t have a problem with either.

Depending on the configuration of the web server, one of the file types will take precedence over the other. This should not be an issue since it’s unlikely that you’ll have both index.htm and index.html sitting in the same folder.

We always use the shorter .htm for our file names since file extensions are typically 3 characters long.

AND MORE ON: http://www.sightspecific.com/~mosh/WWW_FAQ/ext.html or http://www.sightspecific.com/~mosh/WWW_FAQ/ext.htm

i think i should add this part here:
i guess there is one single slight difference btw .html and .html files! consider a path in your server like: mydomain.com/myfolder if you create an index.htm file inside that folder and you open that like this:mydomain.com/myfolder/ it will goes crazy and split 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 loads that file i tested this on my vps and i endup with this answer but maybe you could somehow set your server to loads index.htm files as default. but i guess the .html file is absolutely default file type for browsers to open in each directory!

这篇关于.htm vs .html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆