开发者

Semicolon in CSS [duplicate]

开发者 https://www.devze.com 2022-12-22 03:15 出处:网络
This question already has answers here: Closed开发者_Python百科 10 years ago. Possible Duplicate:
This question already has answers here: Closed开发者_Python百科 10 years ago.

Possible Duplicate:

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

If the IDE by default is adding ; at the end, should I remove it?

selector {property:value;property:value;property:value;property:value;}

I read in an article that a semicolon is not required at the end.


True, it is not required, but I like to leave it in case I want to add any more attributes later. The page weight that it reduces by removing these is negligible.


On the minified version you should remove it.


Either way, it won't affect your styles.


Well.. as you said, it's not required, but no one said, it can not be there... the IDE just adds it, so when you want to add another property, you don't have to add a semicolon.


Yes, it is not required, but for consistency and best practices, just add it.


It is not required by the specification, but, strangely enough, the YUI compressor always adds these semicolons to my CSS files :/ I had to write an additional script for deleting them each time.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号