2012-11-25 2:21, dorayme wrote:
> Your DIV has two classes. You want to style one or both?
An expression like "styling a class" is not technically correct, and it
may confuse people. In CSS, we "style" (assign properties to) elements
or pseudo-elements. We may do this using class selectors, but they are
just ways to select the elements to style.
> If one, just
>
> .region {...}
Such a rule applies to all elements in class "region".
> or
>
> .region-content { ... }
Such a rule applies all elements in class "region-content".
> If you want to style both
>
> .region, .region-content { ... }
>
> Note the comma in the last.
Such a rule applies all elements that belong to class "region" or to
class "region-content" (or both).
A rule like the following applies to any element that belong to both
class "region" and to class "region-content":
.region.region-content { ... }
Given the (lack of) context and explanations of the problem, it is
impossible to say which of the four alternatives is or are suitable.
Each of the rules applies to the element in the question, but this does
not mean that they are equivalent. The selector
.region.region-content
is more specific than the simple class selectors in other alternatives.
This may matter, if there are other CSS rules that apply to the element.
--
Yucca,
http://www.cs.tut.fi/~jkorpela/