What are the most essential ingredients for your skin?
CSS is a web design player. With all the different colors, settings, layout options, and responsive capabilities, it’s easy to turn a stylesheet into a linear nightmare. However, with a few simple steps, you can clean up the mess so that CSS works with you, not against you. A few weeks ago, Julia Cameron, a freelance developer, came by our virtual Treehouse office and got some ideas that we still couldn’t shake. So now I’m sharing it with you all!
It’s natural for clutter to happen.
Cascade is a blessing and a curse. Often times, when you change the appearance of one element, other elements are inadvertently fixed. Take advantage of it! It’s important that the cascade is suspended and prevents you from inconsistencies from one subtle element to the next. As websites get bigger or more developers start working on the code,
CSS tends to grow as well. Without a program, it becomes a wild wild wild (wickey wild, wicky wicky wild wild wild wild west… Will Smith wouldn’t want you to miss this one).
- Modular – You can get to the point of building a page without writing a single line of CSS.
- Predictable – No matter where you place the component, it behaves and looks the same. Write code easily. You have a system for naming it. This makes writing more intuitive.
- Maintainable – Quick and easy to deal with. This is not broken elsewhere on the site.
- Scalable – It’s hard to break and easy to build on.
- Dry – It eliminates the need to copy and paste duplicate CSS.
- Organized – There’s a place for everything
Separating the container from the content means that objects should look the same no matter where you place them. In other words, avoid location-dependent styles. For example, if you style an h2 like this…

دسترسی سریع
Leave a Reply