How important it is to lose sight of the latter "; inside the CSS rule set

I'm having issues with Internet Explorer not applying the last property in the CSS property list. Do I need to leave the last ; from CSS property list? For example:

 .style { width: 100px; height: 100px } 

Or does it really not matter?

+3
css
Mar 10 '10 at 17:38
source share
3 answers

It does not matter. Even Internet Explorer 6 will accept an extra half-hour at the end; your mistake must have been somewhere else.

+9
Mar 10 '10 at 17:39
source share

Extra tip: be absolutely sure , you do not accidentally end the line with two semicolons, for example

 .aStyle { background-color: #FFFFFF;; color: #000000; } 

This can have an extremely unpleasant effect of denying each individual style that appears after it on the page. This is not at all like an extra semicolon at the end of a Javascript line, which has no effect other than adding a character to the weight of the page.

+4
Mar 10 '10 at 17:44
source share

You do not need to include the last comma. And you should not rule it out. It's not obligatory.

In terms of service, I am really used to include after each property. Accidentally forgetting to put one when editing can cause some subtle errors.

I am not aware of any problem with IE causing problems with a missing semicolon - either it was a terribly long time ago, or another problem arose that might make you believe that it was a problem;)

0
Mar 10 '10 at 17:43
source share



All Articles