Forum Moderators: not2easy
The site is still displayed correctly however the code is basically crammed without any spaces in between all the elements. It's usually the type of CSS code I see when I look up the code of other peoples' sites.
Is there any way to make this undone or will I just have to use this code, now and make sure I never do this again?
What browser are you viewing them in, and which software of yours is displaying them if they're all mashed together like that?
Suggestion: always, always, always make dated backup copies of css, htaccess and other files ON the server and on your machine so they can be reverted back to at any time just with a simple filename change. Like style_before_16dec07.css
And when using a revised one, try a test file on a test page using something like style_test.css and page_test.html before letting it go live on a live site.
I've had Notepad do what you're seeing in the past. I've started to use Notetab Light (free) for .php (includes) and css files, as well as for trimming html file sizes, since it has HTML Tidy integrated as well as havig features that strip excess white space, etc. Then I re-do a bit by hand if needed, so formatting is exactly how I want it.
Since Linux uses "\n" (linefeed) for line endings and Windows uses "\r\n" (carriage return + linefeed), if you transfer in binary mode these line endings will be preserved and depending on the application you use, your line endings could be lost. If you transfer in ASCII mode, the line endings are converted.
Conversely, if you upload from Windows to Linux in binary mode you can end up with your code being double line spaced.
This may not be too much of an issue with CSS files, as it may still work, but if you are uploading code (PHP, Perl) that depends on newlines in heredoc strings perhaps then it's critical!
...the code is basically crammed without any spaces in between all the elements.
'Spaces' as well?! Although it's possible with CSS that the only 'spaces' are in fact the newlines?
Is there any way to make this undone...
Download in ASCII mode?
...make sure I never do this again?
If it is an issue with FTP transfer mode, then if you transfer in 'Auto' mode (ie. the FTP software chooses whether to use ASCII or Binary mode depending on file type) then make sure it uses ASCII mode for .css and .htm files etc.
choose 'Replace' in the 'Edit' menu, and put
} }^l the
^l is what stands for a line break. ^t