• Home
  • About
  • Contact
  • Advertise

Devlounge

Design, Develop, and Grow

ateşli sevgilisi fantezisini yaşamak istediğini söyler porno ona arkadaşları varken onunla gizli saklı seks yapmak istediğini sikiş söyleyen kız hafta sonu için gelen arkadaşının görmediği bir sikiş açıdan sakso çekmeye başlayınca adamın yarağını bu altyazılı porno şekilde indiremez ve açık şekilde salonda sikişimeye sex izle başladıklarında misafir kızı da bu sekslerine rokettube konuk ederler seks yapacağını düşünmeyerek onun sex izle oyun oynadığını zanneder sabah olur ve herkes uyanır hd porno bu sırada yanında şişme mankenini de getiren sapık erotik hikayeler genç sınav haftası ders çalışan genç adam üvey annesinin sikiş eve gelmesiyle hayatının şokunu yaşar

  • Home
  • Code
  • Design
  • Design Focus
  • Interviews
  • Publishing
  • Strategy
  • Webapps
  • Extras

Tidy up your stylesheets

January 9, 2009 By Lorraine

It’s 2009, and while I’ve cleared up my desktop clutter, reassigned new icons to my folders, and archived projects from 2008, there’s something that remains unchecked on my to-do list: clean up CSS code. See, I’ve got a bunch of CSS stylesheets that are live, powering different websites, that are shamefully, shamefully disorganized.

Now, the tidying up of CSS doesn’t sound sexy- and it isn’t. But a clean, well-organized stylesheet is a joy to behold. Especially when it’s five months later and time to make major style changes on a website you haven’t worked on, let alone thought about. With an organized stylesheet, there is very little chance of pulling one’s hair out while wondering why that font won’t change size or begging that sidebar to please, please move 20 pixels to the right.

The truth is, it isn’t very hard at all to tidy up the code on a stylesheet. Here are five quick ways to do it:

  1. Use sections. Title these. Organize all style definitions into sections, for example: Basic Page Styles, Links, Header, Content, Footer. Make sure to title each of these sections with headers. Yes, a bit of a pain, but oh how you’ll hug yourself later.
  2. Indent, indent, indent. I heart the tab button on my keyboard, especially when it helps me differentiate various rules (a column within a column, for example) in a stylesheet.
  3. Think semantic. When deciding what to name your CSS ids and classes, use names to properly identify them as they are (“navigation-menu”) rather than where they are (“top-bar”). That way, when you need to move the navigation menu from the top of the page to the bottom, it won’t suffer an identity crisis.
  4. Use shorthand. Learn CSS code shorthand (or, like me, use a cheat sheet) and use it. Because padding: 10px 0 5px 3px;is way better than

    padding-top: 10px;
    padding-right: 0;
    padding-bottom: 5px;
    padding-left: 3px;

  5. Use master stylesheets. As web designers, web browsers are our medium. Unfortunately, despite it being 2009, browsers still don’t all play nicely together. Minimize the risk of your lovely styles disappearing by using master stylesheets, which basically clear all default browser settings, giving you a clean slate to apply your styles on. You can see an example master stylesheet here.

There are, of course, many other ways to organize your CSS stylesheets- and I’m a firm believer that everyone should use the organizational system that works for them. It might be good to keep in mind, though, that unless you’re working on your personal website, there’s a chance that another designer will have to work with your stylesheet in the future. So be kind to that designer, and try not to be too cryptic. That designer could be you.

Filed Under: Design Tagged With: Add new tag, CSS code, CSS stylesheets, indent, stylesheet code, stylesheets

Code & Tutorials

Which Front-End Development Languages Will Grow in 2017?

Your Guide to Leveraging APIs as a Developer

Bitcoin Processing Website Integration For Web Developers

Website Security For 2016 That All Developers Need To Know

5 Reasons You Need to Be Using jQuery

About Devlounge

Want to read more about Devlounge, or maybe you want to contact us, or even advertise? Oh, and don't forget to subscribe to updates!

The Best of Devlounge

Larissa Meek

Search