Hello Readers,
Probably sometimes you see it when you use internal CSS, internal JS or in link text, and you are not if you are not using this (eg.- type="text/css"), also your script and CSS works.
So why we need this?
In the post will discuss the type attribute for script and style what is that and really we need it, huh.
What is type attribute of script and style or what is content-type ?
<style type="text/css"></style>
<script type="text/javascript"></script>
The type attribute is actually required for HTML 4.01 , this content-type is demarcated for the HTTP response
<link rel="stylesheet" type="text/css" href="path">
This defines what content you write and use as a hint to user agents. If you do not write this (in html4) then it can be a possibility that your code gives you a bad response.
is it necessary ?
Yes, If you are using html4 only then but nowadays as you know html5 is in the extreme and html5 have dropped this feature.
So, in html5 you have no need of content type :)
0 Comment(s)