以下獲取的值不對啊<!DOCTYPE html><html><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta http-equiv="X-UA-Compatible" content="ie=edge" /><title>Document</title><style>#box{width: 100px;height: 100px;background: blue;}#box:before{content: '';? width: 0;? ? height: 0;? ? border-bottom: 100px solid red;? ? border-right: 100px solid transparent;}</style></head><body><div id="box"></div><script>var box=document.getElementById("box");var s=document.defaultView.getComputedStyle(box,":after");console.log(s.borderRight)//"0px none rgb(0, 0, 0)"</script></body></html>
getComputedStyle怎么獲取偽元素
我要去幼兒園深造了
2017-12-16 16:04:07