CSS更改不会反映在Polymer中

时间:2016-04-10 09:53:24

标签: javascript html css polymer

我在 hello-world.html

文件中创建了一个聚合物元素
<link rel="import" href="../bower_components/polymer/polymer.html">

<dom-module id="hello-world">

    <template>
        <style>
            h1 
            {
                color: green;
                font-family: Arial;
                text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
            }
        </style>
        <h1>Hello World</h1>
    </template>

    <script>
        Polymer ({ 
            is: "hello-world", 
        }); 
    </script>

</dom-module>

访问hello-world.html的文件名为 index.html

<!DOCTYPE html>

<html>
    <head>
        <script src="bower_components/webcomponentsjs/webcomponents.js"></script>

        <link rel="import" href="elements/hello-world.html">

        <style>
            h1
            {
                color: red;
            }
        </style>
    </head>

    <body>
        <hello-world></hello-world>
        <h1>Hello Arijit</h1>
    </body>
</html>

但是,当我更改 hello-world.html 中的CSS属性并刷新localhost中的 index.html 时,更改不会反映出来。我有什么遗漏的吗?

0 个答案:

没有答案
相关问题