I’ve read some CSS textbook that says, when using <link> to introduce the CSS file, it’s fine to omit the type attribute since browsers today automatically detect its type.
I’m wondering if that still holds true. If we omit the type attribute, anything undesirable might happen?
HTML5 simplified things a little by establishing de facto MIME types for style sheets and scripts, text/css and text/javascript, respectively. That means under that doctype, we no longer need to declare it in our markup.
As far as undesirable outcomes, they would be rare, and only possible in older, out of date user agents. The odds are very small.
Modern browsers are most likely capable of reading file headers which clearly state the MIME type, regardless of the extension deployed.
If a lesson still expects us to use the type attribute on these resources, then humor the author and use it, otherwise, don’t be afraid to leave it out.