Why don't we import css in a div?

I have seen many souce codes but I have never ever come across a code which imports any css file within a div. W3C allows it,

Importing a style sheet to apply as a scoped style sheet:

<div class="navigation"
          style="@import url(navigationstyles.css);">...</div>

Why do people still not use it?


That document you link to is a 10-year-old draft , and far from the latest. Now, if you look at the latest revision of the Style Attributes spec, which is a 2010 Candidate Recommendation that covers basically the same inline style declarations that we use every day, you won't find any @import rules mentioned anywhere anymore.

This means they took it out, presumably because it didn't make sense in retrospect, or it was difficult to implement, or some other reason entirely.

链接地址: http://www.djcxy.com/p/89282.html

上一篇: Html文件未在模拟器中运行

下一篇: 为什么我们不要在一个div中导入css?