Multiple CSS classes on a single element issue

I use a combination of two classes in an element span.

Both look as if they work on their own ... Together they are not.

.black {color:black;}
.size_14 {font-size:14px;}


<span class="black size_14">my text is not black..neither large</span>

I tried changing the class name size_14to another ( large), in which case it works.

Is an size_14invalid class name?

solvable

I redefined behavior

.article_text_div .size_14 {color:#6D6E71;}

But thanks to this error, I found that it is better (?) Not to use underscores inside class names

Double thanks

Luke

+5
source share
4 answers

. , . CSS Firebug , , .

+4

. . .

+2

, , , , , .

.black{color:black;}
.size-14, span.size-14{font-size:14px;}
0

, 2001 . _. "-" .

http://jsfiddle.net/ZsR4A/embedded/result/

IE, FF, Chrome. , _14 .

0
source

All Articles