答案:不是的
在html4版本的年代,type属性是必要的,但html5版本,javaScript的type属性默认就是text/javascript,css的type属性默认就是text/css,所以不是必须的.
当然只有默认type是text/javascript和text/css的时候可以不用写type属性.
下面是官方原文档
The type attribute gives the language of the script or format of the data. If the attribute is present, its value must be a valid MIME type. The charset parameter must not be specified. The default, which is used if the attribute is absent, is "text/javascript".
文档译文:type属性提供脚本的语言或数据的格式。如果属性存在,它的值必须是有效的MIME类型。不能指定字符集参数。默认值是“text/javascript”,如果属性不存在,则使用该值。
转载自: csdn博主"只想发财".