阅读背景:

JavaScript没有看到backgroundColor?

来源:互联网 

Why I can't see my style?

为什么我看不到自己的风格?

    <style>
        .style{
            background-color: pink;
            top: 50px;
            left: 50px;
        }
    </style>
    <script>
        window.onload = function () {
            console.log(document.querySelector('.style').style.backgroundColor);
        }
    </script>
    </head>
    <body><div class="style">A</div></body>
   



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: