No, you cannot do this with a single class definition. In CSS there is no concept of parameters and function calls.
On the other hand, you can do this with minimal code duplication, but this is probably a bad idea. You say you want to assume that there is only one class name in the class attribute. This is pretty stupid because he completely misunderstands what the class attribute means, but we will roll back from it anyway.
Let's start by defining our classes with just the background color:
.mybody-red { background-color: red; } .mybody-blue { background-color: blue; } .mybody-green { background-color: green; }
Then we define the code for all mybody-* classes with the start-with selector attribute:
div[class^="mybody-"] { font-size: 11px; color: Black; border: 1px solid; }
This, however, is a stupid idea, not least because it means that you do not separate the markup from the stylization for many other reasons.
source share