oDiv.style.
只能获取到行内样式的设定的css属性和属性值
<div>我是div</div>
var oDiv = document.querySelector('div');
// 设定 css样式
oDiv.style.color = 'red';
oDiv.style.width = '400px';
oDiv.style.height = '200px';
oDiv.style.background = 'pink';
// 小驼峰命名法
oDiv.style.fontSize = '50px';
getComputedStyle 获取CSS属性值
if(window.getComputedStyle){
// 这个方法是可以使用的
console.log(window.getComputedStyle(oDiv).width);
}else{
// 兼容IE的方法
console.log(oDiv.currentStyle.width);
}