- <html>
- <head>
- <style>
- #mask {
- position: absolute;
- z-index: 1000;
- top: 10px; left: 0;
- background: blue;
- width: 100px;
- height: 100px;
- }
- </style>
- </head>
- <body>
- <div id="mask" style="border: dashed"></div>
- <script>
- var mask = document.getElementById('mask');
- var style = window.getComputedStyle(mask, "");
- console.log('34',style.position,mask.style.border);
- </script>
- </body>
- </html>
来源: http://www.bubuko.com/infodetail-2055362.html