Skip to content Skip to sidebar Skip to footer

Why Do We Have To Use "link" Tag For Css Files

Why this is not allowed: whereas this is allowed: I don't understand why i hav

Solution 1:

Do you know when all these tags introduced in HTML? There is a reason why the <LINK> tag is used instead of the <style> tag.

It makes the most sense for individuals using HTML who want to see where HTML has been and where it is going.


HTML1.0

  • HTML1.0 was the earliest version of HTML, used from 1989 to 1994. It was a very limited version and only contained 20 elements. But there was no link or style tag in the 20 elements.

HTML2.0

  • This version was created in 1995, with significant improvements to HTML1.0. A <link> tag was added to this version. The <LINK> tag is presented as a general purpose link to other documents. Styling sheets are indicated as a possibility.
<linkrel="stylesheet"href="styles.css">

HTML3.2

  • The HTML3.2 version was endorsed by the W3 consortium in January 1997 and was approved by many, including notable browsers such as Netscape and Microsoft. And this version included a style and script tag. <style> tag "Reserved for future use with internal style sheet."
<styletype="text/css"></style>

So the <link> tag is already used to include the external style in the page. The <style> tag was introduced after the <link> tag, but it is not used to include external style.

Because there was already a <link> tag to include the external style and HTML has never devalued a single tag. Sources used: Link

Solution 2:

The World Wide Web Consortium (W3C) is the main international standards organization for the World Wide Web. This may help to understand why we use the tags we do.

About Styles https://www.w3.org/Style/

About Scripts https://www.w3.org/TR/2011/WD-html5-author-20110705/the-script-element.html

Post a Comment for "Why Do We Have To Use "link" Tag For Css Files"