What’s the difference between @ link and @ import? what’s the diffrence between link and @import ?

Time:2021-4-22

What’s the diffrence between link and @import ?

  • the link belongs to the tags of xhtml, but @import is provided by css
  • the link will loading when the web page is loaded, but css that referenced by @import will wait until the web page is loaded.
  • the @import just can be recognized in ie5 and above, but link is xhtml tag, doesn’t has the issue of compatibility.
  • the weight of the link style is higher than the weight of @import
  • the difference of controling the style of dom, we can only use the link tag when using the js to control the dom to change its style. because the @import is not controllable by the dom.

What’s the difference between @ link and @ import?

  • linkbelong toXHTMLLabel, and@importyesCSSProvided.
  • When the page is loaded,linkWill be loaded at the same time, and@importQuotedCSSIt will wait until the page is loaded.
  • importOnly inIE 5The above can be identified, andlinkyesXHTMLLabel, no compatibility issues.
  • linkThe style weight of the method is higher than that of the method@importThe weight of the system.
  • usedomControl the difference in style. When usingjavascriptcontroldomTo change the style, you can only uselinkLabel, because@importnodomIt’s controllable.