为什么不在div中导入css? [英] Why don't we import css in a div?

查看:69
本文介绍了为什么不在div中导入css?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看过许多souce代码,但我从来没有遇到过在div中导入任何css文件的代码。 W3C 允许它,

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?

推荐答案

您链接到的文档是 10岁草稿,远离最新版本。现在,如果您查看最新版本的Style Attributes spec ,这是一个2010候选建议,涵盖基本上与我们每天使用的相同的内联样式声明,您将不会在任何地方找到任何 @import 规则。

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.

这篇关于为什么不在div中导入css?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆