(() => {
const el = document.querySelector('你的元素选择器');
const style = window.getComputedStyle(el);
return {
contentVsContainer: {
height: `${el.scrollHeight} > ${el.clientHeight}`,
width: `${el.scrollWidth} > ${el.clientWidth}`
},
overflow: style.overflow,
dimensions: {
specified: {
width: style.width,
height: style.height
},
actual: {
width: `${el.offsetWidth}px`,
height: `${el.offsetHeight}px`
}
},
position: style.position,
display: style.display,
flexChild: el.parentElement ? window.getComputedStyle(el.parentElement).display === 'flex' : false
};
})();