I have been creating a mobile site based on oding from iWebKit 5, I have been using their css stylesheet and all is working fine, however the formatting of the css is all on one line, this obviously makes it confusing and almost impossible to read, so I wish to format it. I have tried many online formatters but they somehow either compress the code and screw it up or they rearrange it and it doesn't end up working. I have also had issues with certain formatters removing what they deem "bad attributes" which are actually iDevice specific styles.
So my question is, is there something/someone that could help me re arrange my code into a readable but obviously functioning css stylesheet?
Here is the link to the stylesheet:
-
1Have you tried ProCSSor? Your link won't load, either. Please put your CSS on Pastebin, or another more reliable server.Bojangles– Bojangles2012年04月14日 14:27:45 +00:00Commented Apr 14, 2012 at 14:27
-
1Your link doesn't load for me, can you post it over at pastebin.com?Andres I Perez– Andres I Perez2012年04月14日 14:28:37 +00:00Commented Apr 14, 2012 at 14:28
-
1It does load, it's just really slow. Probably because none of us are anywhere near Australia :-)T. Junghans– T. Junghans2012年04月14日 14:30:45 +00:00Commented Apr 14, 2012 at 14:30
-
This should probably be migrated to codereview.stackexchange.comSparky– Sparky2012年04月14日 14:35:01 +00:00Commented Apr 14, 2012 at 14:35
-
pastebin.com/czuuaPyn is the link to the CSS, I shall try ProCSSor and report back :)Ben Green– Ben Green2012年04月14日 14:35:20 +00:00Commented Apr 14, 2012 at 14:35
3 Answers 3
I hardly ever have to do this the other way around but when the occasion does arise, I go for an online-tool such as http://cssbeautify.com/. It's pretty good for "untangling" css.
1 Comment
Quick and dirty solution:
- Open the file in any editor that has Search+Replace
- Replace
{with{\n\t - Replace
;with;\n\t - Replace
}with\n}\n - Tidy up any irregularities (particularly comments, possibly media queries)
Comments
This should do it:
Ran it through a Codebeautifier without any filters or modifiers enabled.