Answer the question
In order to leave comments, you need to log in
Compressing CSS on the server?
Good morning Khabrchane!
I ran into this problem here. There is hosting, it hosts a number of sites, and sites are edited from time to time. I began to notice that the CSS files downloaded from the server are all compressed (no formatting, no spaces, comments, etc.) Until today, I was surprised at this, but did not attach any importance to it. But today in one of the sites I need to make drastic changes in CSS, and when I opened the file, I again stumbled upon the problem of compressed CSS. Due to the lack of formatting, it is very difficult to make changes to the code, it takes a very long time.
I wanted to ask you if there is a tool for reformatting css files? And how to deal with this compression?
I understand that compression is good, but on these projects it is not necessary, since the projects are not large.
Thanks in advance for your reply!
Answer the question
In order to leave comments, you need to log in
I am almost sure that the reason for this is UNIX / Windows encodings. In one case, a line break is a special character \n, in the other - \n\r
. As a panacea for this, a more or less advanced editor. I recommend notepad++
Dreamweaver has an Apply source formatting tool on the Commands menu .
In general, you can store an uncompressed version of the file and edit it.
I found a service for CSS formatting since I don't use Dreamweaver: www.lonniebest.com/FormatCSS/ helped
But still I wonder why the compression occurs!?
Another service is procssor.com - there are more formatting options than in www.lonniebest.com/FormatCSS/
Thanks I'll try. Yes, just a lot of changes were already made right on the hosting, so the uncompressed version is of little use. I did not compress it, it is not clear for what reason compression occurs at all, except for me, no one has access to hosting. Such compression occurs on all my projects on this hosting
At the CMS level, it was not implemented exactly, because the CMS is mine, I wrote everything myself from scratch, but I also thought about the server, so I wanted to ask if this is possible at the server level, it turns out to be possible. You need to knock on the TP, otherwise this will not work, very often changes are made on the fly from several computers, so it is not always possible to save an uncompressed copy
Here it is again, just uploaded the formatted css to ftp and immediately uploaded it back for viewing and it's compressed!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question