Is CSS giving error?

后端 未结 19 1377
傲寒
傲寒 2020-12-29 21:35

At a recent interview I was asked the question \"Is CSS giving error?\" by the interviewer.

Is there an interpreter working behind CSS which blocks

19条回答
  •  感情败类
    2020-12-29 22:30

    Generally errors in the CSS doesn't cause any error messages in the browser. Any incorrect code is simply ignored (or in some cases accepted by assuming a missing part, e.g. a length unit).

    The CSS parser tries to recover after each incorrect code, so usually it will only affect the style or the rule where the error is, the parser won't just stop parsing the rest of the CSS code.

    Some browsers will add warnings to the error console for errors in the CSS, so developers can open the console to see if there is any errors.

提交回复
热议问题