返回:
x        坐标x
y        坐标y
left     左边
right    右边
top      上边
bottom   下边
width    宽度
height   高度


注:返回值是相对浏览器窗口的位置



示例:

HTML: <div id="d0"></div> css: div{ width:100px; height:100px; border:1px solid #f00; } JavaScript: var rect = document.getElementById("d0").getBoundingClientRect(); rect.width; //返回div标签宽度