Reputation: 61773
I've looked at half a dozen CSS optimisers out there. What I'm looking for is one that will turn:
background-image: url(../images/background.png);
background-repeat: repeat-x;
background-color: #c0c0c0;
Into the single background property:
background: #c0c0c0 url(../images/background.png) repeat-x;
How can I do this? Do I have to do it by hand?
Upvotes: 6
Views: 585
Reputation: 3136
Make sure you also have gzip enabled on your server (or some other form of compression for text files).
Upvotes: 4
Reputation: 228302
Try http://www.cssoptimiser.com/
Input:
body {
background-image: url(../images/background.png);
background-repeat: repeat-x;
background-color: #c0c0c0;
}
(I ticked "Do not remove line breaks")
Output:
body {
background:#c0c0c0 url(../images/background.png) repeat-x
}
Note that it also optimised away the space - you asked for background:<space>#...
:)
There may be other/better tools which can do this, but that site does fulfill your wish.
Upvotes: 16