In CSS, semicolons are needed to separate each statement ... However, the final semicolon in a set of statements is optional (but most developers recommend using it). In your case, there was only one statement, so it is technically the last and thus, the semicolon is technically not needed.
Is semicolon compulsory in CSS?
No, semicolons are only required to separate rules in CSS blocks. Semicolons are delimiters, not terminators.
What is the role of semicolon in CSS?
In CSS, the colon separates syntax, and the semicolon denotes that that particular styling is over. For example: position : relative ; The statement above is saying that you want the CSS to be looking at the position attribute, and you want it to be of a relative nature.