Trim your CSS
If you’re not careful when developing a website, you may end up with a bloated CSS file that is easy to get lost in and difficult to maintain. It will also add to total page weight, taking away some of the advantage of having nice and clean HTML. From personal experience I can tell you that a CSS file for a large and complex website can end up containing quite a bit of redundant code.
If you get rid of that code and clean up your CSS file, it will be easier to come back to and make changes, and you will save some bandwidth. John Gallant (a.k.a. Big John) and Holly Bergevin tell you how in Writing Efficient CSS at Community MX. Methods include shorthand properties, multiple declarations, default values, inheritance and white space.
- Previous post: Multiple paragraphs in list items
- Next post: Website reviews
Subscribe / follow
Sponsors
Authentic Jobs
- Front-end Developer and UI/UX Designer at DrivingSales, LLC (Salt Lake City, UT, Ut, US)
- Dev Ops Engineer @ General Things at The Sourcery (San Francisco, CA, Ca, US)
- Java Software Developer eCommerce at arvato Systems North America (New York, NY; San Francisco, CA; Chicago, IL, Il, US)
- PHP Developer at 428 Designs
DreamHost web hosting
Use the promo code 456BEREASTREET3 to save USD 20 when you sign up for DreamHost


Comments
Yeah, I just ended up there myself, and that was only a small site such as my personal homepage. I ended up with lots of overlapping classes and other cruft in my CSS. So I decided to redesign it from scratch and keep a nice, clean CSS file this time.
Comments are disabled for this post (read why), but if you have spotted an error or have additional info that you think should be in this post, feel free to contact me.