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
I think the "Is CSS giving error?" statement is ambiguous, but let's first take a look at this link (CSS 2.1 Specification), jump to 4.2 Rules for handling parsing errors
The specification explicitly specifies how parsing errors should be ignored, in fact, it says:
This specification
defines ignore to mean that the user agent parses the illegal part (in order to find
its beginning and end), but otherwise acts as if it had not been there
In fact, in same cases it even specifies how to turn an invalid piece of css into a valid one:
User agents must close all open constructs (for example: blocks, parentheses,
brackets, rules, strings, and comments) at the end of the stylesheet. For
example:
@media screen {
p:before { content: ’Hello
would be treated the same as:
@media screen {
p:before { content: ’Hello’; }
}
So looking from this perspective, CSS never "gives" errors, because any errors will be effectively parsed and fixed or ignored, but will never stop execution of the rules nor the parser.
However, if you have one developer talking to another in front of an IDE, I think it would be fair enough to ask "Is the CSS giving errors" referring to the IDE's messages and in fact, if we look at a CSS parser project we can clearly see in the documentation that the parser can give error messages, it's just browsers that were directly instructed to ignore errors.