css-insert-import-rule.html 286 Bytes
Newer Older
rwlbuis's avatar
rwlbuis committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<head>
<style>
div {
    width: 100px;
    height: 100px;
    background-color: red;
}
</style>

<script>
function test() {
  document.styleSheets[0].insertRule('@import url("resources/css-insert-import-rule.css");', 0);
}
</script>

</head>
<body onload="test()";>
<div></div>
</body>