<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                >[danger]介紹一下Js中的getComputedStyle `getComputedStyle()`是一個可以獲取當前元素所有最終使用的CSS屬性值的方法。返回的是一個CSS樣式聲明對象。 這個方法有兩個參數,第一個參數是你想要獲取哪個元素的 CSS ,第二個參數是一個偽元素。 >[info]用法 ~~~ <style> #box { width: 200px; height: 200px; background-color: cornflowerblue; position: relative; } #box::after { content: ""; width: 50px; height: 50px; background: #000; position: absolute; top: 0; left: 0; } </style> ~~~ ~~~ const box = document.getElementById('box') const style = window.getComputedStyle(box, 'after') const height = style.getPropertyValue('height') const width = style.getPropertyValue('width') console.log(style); console.log(width, height); ~~~ 上述代碼輸出結果為: ![](https://img.kancloud.cn/9d/d5/9dd5654eb78f1f77f97455870dc1b9ab_232x46.png) 有一個 id 為 box 容器的 CSS 樣式聲明對象,以及偽元素的寬高。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看