0

I have noticed that in a CSS rule, I can leave off the last semicolon and it still works:

p {
    color: black;
    font-weight: bold;
    font-size: 17px
}

Also, if I am commenting out something at the end of an inline style, I can leave off the closing */ and it still works:

<p style="color:red;/*font-style:italic">Red</p>

Is this valid syntax, or is it just the web browser gracefully handling my messy code?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
chiliNUT
  • 18,989
  • 14
  • 66
  • 106

0 Answers0