为什么< script src =" min.js">< / script>但< link rel =" stylesheet" href =“min”>为什么不< style href =" min.css">< / style> [英] Why <script src="min.js"></script> but <link rel="stylesheet" href="min"> why not <style href="min.css"></style>

查看:141
本文介绍了为什么< script src =" min.js">< / script>但< link rel =" stylesheet" href =“min”>为什么不< style href =" min.css">< / style>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始学习Web开发的亲戚问我这个问题。



为什么< script src =min.js>< / script> $ c>< link rel =stylesheethref =min.css> 为什么不< style href =min.css> style> 为什么我们使用链接标签在页面中添加外部css,但是当我们链接css到页面,但我们使用 < style> ...< / style> 当我们在< head>

我告诉他,这是因为规范。

解决方案

这是历史的...巧合吗?您可以推荐他阅读有关diveintohtml5.info过去的部分,其中有一些有趣的故事,实际上是邮件通信,在Web开发人员之间。网络开发人员意味着他们实际上是开发我们现在看到的网络);



< img> 标记我们习惯于:

 < IMG SRC =file://foobar.com/foo/bar/blargh.xbm> 

可以是:

 < ICON name =NoEntryhref =http://note/foo/bar/NoEntry.xbm> 

 < A HREF =...INCLUDE>查看照片< / A> 

 < INCLUDE HREF =...> 

$ b $

$

$ b


我们现在不准备支持INCLUDE / EMBED。 ...所以我们是
可能会去(不是ICON,因为不是所有的
内联的图像可以被有意义地称为图标)。暂时,
内联的图像不会被明确地内容类型化;在路上,我们
计划支持它(与MIME的一般适配)。
实际上,我们目前使用的图像读取程序在运行时会显示
的图像格式,因此文件扩展名甚至不会是
有效的。


我不知道直接回答你的问题,但我很好奇< link> 标签。找到答案可能包括一些网络档案挖掘。


A relative of mine who started to learn Web Development asked me this question.

Why <script src="min.js"></script> but <link rel="stylesheet" href="min.css"> why not <style href="min.css"></style> why we use link tag to add external css in the page but when we link css to page but we use <style>...</style> when we write css inside <head>?

I told him that it's because of Specification. Is there any more info to give to him?

解决方案

It's historical... coincidence? You can recommend him reading part about Past of diveintohtml5.info, where there are some interesting stories, actually mail correspondences, between web developers. Web developers means they were, in fact, developing the Web we see nowadays ;)

I.e. <img> tag we are used to:

<IMG SRC="file://foobar.com/foo/bar/blargh.xbm">

could be:

<ICON name="NoEntry" href="http://note/foo/bar/NoEntry.xbm">

or

<A HREF="..." INCLUDE>See photo</A>

or

<INCLUDE HREF="...">

but finally devs decided to stick with <img>, which was already implemented:

We’re not prepared to support INCLUDE/EMBED at this point. … So we’re probably going to go with (not ICON, since not all inlined images can be meaningfully called icons). For the time being, inlined images won’t be explicitly content-type’d; down the road, we plan to support that (along with the general adaptation of MIME). Actually, the image reading routines we’re currently using figure out the image format on the fly, so the filename extension won’t even be significant.

I don't know direct answer to your question, but I'm pretty curious about <link> tag, too. Finding answer would probably include some web archives digging.

这篇关于为什么&lt; script src =&quot; min.js&quot;&gt;&lt; / script&gt;但&lt; link rel =&quot; stylesheet&quot; href =“min”&gt;为什么不&lt; style href =&quot; min.css&quot;&gt;&lt; / style&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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