How important is it to leave out the last ';' inside a set of CSS rules?

后端 未结 3 1332
伪装坚强ぢ
伪装坚强ぢ 2021-01-14 18:52

I\'ve had problems with Internet Explorer not applying the last property in a list of CSS properties. Is it necessary to leave out the last ; from a list of CSS

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-14 19:31

    Additional advice: Be absolutely sure you don't accidentally end a line with double semicolons, like

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

    This can have the extremely unhappy effect of negating every single style that comes after it on the page. It is not at all like an additional semicolon at the end of a line of Javascript, which has no effect whatsoever except to add a character to the page weight.

提交回复
热议问题