roo*_*ook 4 html css internet-explorer
首先让我非常清楚.我在谈论在html style=''属性中导入css文件.您可以假设Internet Explorer 9.
我不关心<link>TAGS或其他导入css的方法.
假设我有一个简单的.css文件:
#inputArea{
width: width:72px;
}
Run Code Online (Sandbox Code Playgroud)
为什么这个导入不起作用?
<input type=text id='inputArea' style="@import url(simple.css);">
Run Code Online (Sandbox Code Playgroud)
这个导入确实有效吗?
<style>
@import url(simple.css);
</style>
Run Code Online (Sandbox Code Playgroud)
style=""属性导入何时起作用?为什么这个不起作用?
该style属性采用声明列表,并将该列表中的属性专门应用于owner元素.
@import不是声明,也不适用于特定元素.它只能与@构成语句的选择器和其他构造一起出现在样式表的顶层.
将包含选择其他元素的规则的样式表导入到元素的内联样式中没有任何意义.这就像说:
<input type=text id='inputArea' style="body { margin: 0 }">
Run Code Online (Sandbox Code Playgroud)
这同样毫无意义.