I made a cool little CSS discovery recently that I have already found to be quite powerful.
Using the class selector is done with the “.” character.
.foo { color: #ff0000; } makes any <div class=”foo” /> have red text. Likwise, .bar { font-size: 50px; } makes any <div class=”bar” /> have really really big text.
With CSS, it is possible to apply multiple classes to the same element by separating them with a space. In fact, <div class=”foo bar” /> will have really really big text that is also red in color.
But what I recently discovered is that it is possible to define a style that only applies to those elements that have all of the specified classes set. This means we can create a style that is only seen when an element has both class ‘foo’ AND class ‘bar.’
This is done like so,
.foo.bar { background-color: #ff00ff; }
Now, <div class=”foo” /> and <div class=”bar” /> will both take the background of their parent, but <div class=”foo bar” /> will have a rockin’ magenta background.
Pretty cool.
This is just a simple example. What is really going on here is that we are giving a style to a set of classes. And this style gets applied whenever that set is a subset of an element’s classes.
<div class=”a b c d e f”>Hello World.</div> (This element has a class set of {‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’})
.c.b.a { color: #00cc00; } (This CSS style has a class set of {‘c’, ‘b’, ‘a’}).
Since {‘c’, ‘b’, ‘a’} {‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’}, our <div> will get this style.
Hmm, I feel a set theory post coming on.




Dynamit was honored as one of the “Best Places to Work” in 2010 & 2011 by Columbus Business First newspaper and Interactive Agency of the Year. Times are even better in 2012 and we’re hiring a Web/Graphic Designer for our aggressively growing team.
This is an exciting opportunity to work on cutting edge projects for well-known brands in a dynamic, entrepreneurial and highly creative environment. Please email resumes/cover letters and portfolio information (documents or links to online examples) to Gary Moneysmith via gmoney@dynamit.us.
A web/graphic designer on the Dynamit team will:
Experience is important, but personality is key. Our culture is what drives us, and we’re looking to build our team with someone who both fits and contributes to it.
The position is full time at our office in the Arena District in Columbus, Ohio. We offer a competitive salary and benefits package as well as a fun, high-energy, intellectually-stimulating work environment.
Benefits Include
Don’t sit back. If you want to work in a fast paced work environment with great people who love what they do, apply today.
About Dynamit
Dynamit is a digital agency based in the Arena District in Columbus, Ohio. We work with clients and brands on digital initiatives that include strategy, design, user experience and development. We influence communication and commerce. Client work includes Hilton Worldwide, Charley's Grilled Subs, McGraw-Hill, British Broadcasting Corporation (BBC), E-Z-GO, American Electric Power (AEP), Columbus College of Art & Design and the Ohio State Medical Center (OSUMC) to name but a few.



