[TYPO3] Indentation problem in typo3 4.2.1 [OT]
Christopher Torgalson
bedlamhotel at gmail.com
Wed Aug 27 16:24:25 CEST 2008
On 27-Aug-08, at 4:04 PM, Fearless Goblin (Victor Livakovsky) wrote:
<snip>
> Also sometimes CSS-styles won't work, if you have not specified the
> inlaid level for them.
> F.e. we have such structure:
> <div id="header">
> <div class="subheader">
> <div id="header_menu">
> <ul>
> <li class="active">Item1</li>
> <li>Item2</li>
> <li>Item2</li>
> </ul>
> </div>
> </div>
> </div>
>
> and when I specified something like this:
> .active {
> color: red;
> }
> it didn't worked!
>
> But, f.e., this:
> #header_menu ul li.active {
> color: red;
> }
> worked fine!
>
> I don't know why it's so, but the fact still remains.
What you're describing is an issue of specificity.
In the specific case above, some more specific CSS declaration must
already have defined the 'color' property for the element in question.
By using a descendent selector (#header_menu ul li.active), you're
using a *more specific selector* than whatever was already defining
the color, so the color of the element's text follows the new rule.
--
Christopher Torgalson
http://www.typo3apprentice.com/
More information about the TYPO3-english
mailing list