<div id="boy" style="width: 100px;">男孩</div>
/**
* 获取节点最终css值
*/
var node = document.getElementById('boy');
console.log(window.getComputedStyle(node,null).width) //输出:100px
<div id="boy" style="width: 100px;">男孩</div>
/**
* 获取节点最终css值
*/
var node = document.getElementById('boy');
console.log(window.getComputedStyle(node,null).width) //输出:100px