@import directive

@import url(sheet2.css);

  • Just like link, @import can be used to direct the web browser to load an external style sheet and use its styles in the rendering of the HTML document. The only major difference is in the actual syntax and placement of the command. @import is found inside the style container. It must be placed there, before the other CSS rules, otherwise it won’t work at all.
  • Like link, there can be more than one @import statement in a document
  • You can’t put an @import into a style attribute, nor can you include any complete rules.

By Bryan Xu