CSS files can get confused. There are some talented people who think through their HTML design in order to reduce the amount of CSS code needed. However, for most of us or maybe just some of us, our CSS files get bulky. Bulky CSS files take up space. Lots of space means extra bandwidth. Extra bandwidth means heavy financial burden.
Cascading Style Sheet optimization can be a confusing topic. The goal of CSS optimization is dual. First, it is meant to cleanup some of the CSS code in order to reduce the number of selectors and/or properties. Second, it simply is a medium to remove the white space from a file in order to reduce its size. The second goal is the one most sought after. The first is sometimes hard to achieve with a tool. There are several tools out there that can accomplish these tasks. But CSS Tweak and Code Beautifier are the most popular tools.
CSS Tweak is a beginner friendly tool that is excellent at removing the white space from a file without changing any of the code. CSS Tweak has the ability to tweak fonts, borders, backgrounds and lists, but its main use is for removing comments, zero units and white space. It is advisable for beginners to focus on simply removing the white space in order to reduce the size of their files. Then focus on the actual code once some confidence is gained in writing CSS files.
CSS Tweak is very easy to use. All you need to do is to upload a style sheet and click Tweak. However, you should know the various options available before moving further.
• Tweak Fonts - Merge font related properties into one “font” property.
• Tweak Backgrounds - Merge background related properties into one “background” property.
• Tweak Borders - Merge border related properties into one “border” property.
• Tweak Lists - Merge link styling properties into one “link-style” property.
• Remove Comments – Strip out all comments.
• Remove zero units - Clean up zero unit values.
• Formatting - Strips white space. This compresses your cascading style sheet.
The general recommendation is to leave the code optimization selections alone until you understand CSS better. It can adversely affect your CSS code. Unless you understand CSS well, you may not be able to work out what changes the Tweaker made that are now causing problems. Beginners should only check the “Remove Comments” and “Remove White Space” radio boxes. Clicking Tweak will then create a new style sheet file that can be downloaded
Maintaining two style sheets involves a lot of work. Don’t compress it until you are finished the design. That way you won’t have to go from side to side between compressed and non-compressed. Compressing the style sheet is worth it. It can significantly save on download times.
Advanced users may want to use Code Beautifier. While it removes white space just like CSS Tweak, it contains more power features. Code Beautifier can change the case of all selectors to reordering all your selectors. But beware this can affect the output of your CSS code. Power CSS writers may appreciate its features, but they better be careful.
In the end, the most important goal of CSS optimization is to decrease your white space so you can trim down the size of your CSS file. Reducing the size of your CSS file will save on bandwidth and may have a positive effect on the speed of your website.



english
español
Deutsch
français
Italiano
Português
русский










Beantworten