I am creating several css buttons and would like them to be as short as possible, so I started like this
[class*='mybuttons-button']{ margin-top:5px; -webkit-border-radius:4px; -khtml-border-radius:4px; -moz-border-radius:4px; border-radius:4px; display:inline-block; padding:6px 12px; color:#fff; vertical-align:middle; cursor:pointer; }
which will affect all elements containing the my-button class
now I want to go deeper into it and do it
[class*='-large']{ padding: 10px 16px; font-size:120%; line-height: 1.33; -webkit-border-radius:6px; -khtml-border-radius:6px; -moz-border-radius:6px; border-radius:6px; } [class*='mybuttons-button-color']{ background:blue; }
but since the -large class may appear in some third-party CSS added by the user, I would like to be more specific and say something like this instead
[class*='mybuttons-button-*ANYTHING*-large']
so I should not do that
mybuttons-button-color-large mybuttons-button-red-large mybuttons-button-green-large mybuttons-button-color-medium mybuttons-button-red-medium mybuttons-button-green-medium
Does anyone know how to do this? Is it possible at all to have a nail instead of a middle word instead?
I know that I can run through class names, etc., but I would like to try this because for me it **
<span class="mybuttons-button-color-large"></span>
looks cleaner than this:
<span class="mybuttons-button color large"></span>
css css-selectors
Benn
source share