以下获取的值不对啊
<!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>
产品经理不是经理
相关分类