html – Is it possible to detect unknown CSS properties or invalid CSS property values with JavaScript-ThrowExceptions

Exception or error:

I lost a bit of time to find out why a web page rendered somewhat unexpectedly. It turned out that the cause was a misspelled CSS attribute name (something like <div style='postion:absolute'>).

I am now wondering if it is possible to detect unknown CSS properties or invalid CSS property values in JavaScript, after a document has loaded or while the CSS properties are parsed.

How to solve:

The best way to do that is to use an IDE/Code Editor/Text Editor.

Good IDE/Code Editor show error for such codes.

EXAMPLE: (Code Editor: VS Code)
Better Way

or

You can use the browser developer tools to find errors.

EXAMPLE: (Browser: Google Chrome)
enter image description here

Both Images use your code…

Leave a Reply

Your email address will not be published. Required fields are marked *