tags:

views:

109

answers:

6
+1  Q: 

semicolon in css..

if IDE by default adding ; at end. should i remove?

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

I read on an article semicolon not required at end.

A: 

Either way, it won't affect your styles.

Wayne Khan
A: 

well.. as you said, its not required, but no one said, it can not be there... ide just adds it, so when you want to add another property, you don't have to add semicolon

fazo
+7  A: 

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.

zac
I read on another article "removing unneeded semicolon reduce the size of css"
metal-gear-solid
true it does but unless your css files are really, really massive it is only going to amount to a "handful" of kB... run your file through a CSS Tidy if you want to see the difference
zac
I agree; I always keep those ending semi-colons for ease of adding more attributes later.
contactmatt
A: 

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

hallie
+1  A: 

On the minified version you should remove it.

Mendy
A: 

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

Webmezha