Javascript element style

后端 未结 4 1034
名媛妹妹
名媛妹妹 2021-01-12 09:14

I\'m curious why this one

fdsfsd
.overlay{ width: 100px; height: 200px; background-color:red; }
4条回答
  •  借酒劲吻你
    2021-01-12 09:35

    The .style is inline style="width:100px;" only...

    If it's in CSS (rather than inline) you need getComputedStyle -

    https://developer.mozilla.org/en/docs/Web/API/window.getComputedStyle

提交回复
热议问题