is there a list of default values of css properties ? (so I can make an exclusion array in js for them)

后端 未结 5 2129
不知归路
不知归路 2021-01-25 08:00

All sites that list css properties such like MDN or w3schools list every CSS property on separate pages.

When I\'m iterating over CSSStyleDeclaration I get

5条回答
  •  灰色年华
    2021-01-25 08:21

    You can create a new element with the same tag you are examining, and not append it to the document. It will have a style object with only the defaults set, and can be compared to the element in question- but it seems silly.

    The defaults are just as real as any style assignments in style sheets- the browser does not ignore them, why would you?

提交回复
热议问题