hi i always delete white spaces between lines in my css files before upload it to server. i mean if my css file contains codes like this: body { position: relative; background-color: #ffffff; text-align: center; } Code (markup): i turn it to something like this: body {position: relative; background-color: #ffffff; text-align: center;} Code (markup): i do myself that takes alot of time. is there any tool for doing in a css file? i wonder if IDE s like dreamweaver or frontpage have this feature or not?
You may use php to do that. <?php // Path to css file. $cssFileLocation = 'http://test.com/test.css' echo str_replace(array("\r","\n"), ' ', file_get_contents($cssFileLocation)); ?> PHP:
One tool that I use is http://www.cleancss.com. Not only do I use it for eliminating white-space, but it comes in handy when reading others' CSS code that's formatted weirdly. The down-side is some browser-specific properties get messed up, and sometimes opacity values can be handled wrong.
TanX, but i've searched css optimize, clean css, but could not find anything in firefox add on repository, i would be thankful if u mention th name.