.htm or .html extension - which one is correct and

2019-03-10 12:37发布

When I save a file with an .htm or .html extension, which one is correct and what is different?

10条回答
Summer. ? 凉城
2楼-- · 2019-03-10 12:50

Neither is wrong, it's a matter of preference. Traditionally, MS software uses htm by default, and *nix prefers html.

As oded pointed out below, the .htm tradition was carried over from win 3.xx, where file extensions were limited to three characters.

查看更多
爱情/是我丢掉的垃圾
3楼-- · 2019-03-10 12:50

Mainly, the number of characters is different.

".htm" smells of Microsoft operating systems where the file system historically limited file name extensions (the part of the file name after the dot) to 3 characters.

".html" smells of Un*x operating systems that did not have this limitation and that were used for all the serious internet work at the time.

Pragmatically, the two are equivalent.

The difference is cultural. ".html" is regarded by some as more correct. The same people tend to look down at Microsoft operating systems and regard ".htm" as unsightly reminder of their limitations.

查看更多
淡お忘
4楼-- · 2019-03-10 12:56

I use .htm. Less typing I guess. Or perhaps it's my windows-bias.

查看更多
我想做一个坏孩纸
5楼-- · 2019-03-10 12:58

Both are correct back in the past file extensions had to be a maximum of 3 characters long.

http://en.wikipedia.org/wiki/Filename_extension

查看更多
Ridiculous、
6楼-- · 2019-03-10 13:02

Both are working as same,but For the technical and non technical reference please find out here, http://www.sightspecific.com/~mosh/www_faq/ext.html

查看更多
不美不萌又怎样
7楼-- · 2019-03-10 13:03

They are completely interchangeable. If I understand the history properly then in the beginning the correct extension was .html but when Windows 95 came along it could only cope with 3 character extensions.

So .html is correct according to some standard or other but in practice it doesn't matter (most of the time...have just done a quick google search and found the following)

There is one area of concern though, most host servers will require your default starting page to be named as "index.html" and not as "index.htm"

查看更多
登录 后发表回答