CSS - problem ze zdefiniowaniem selectora
Marek - 09-02-2010 10:47
CSS - problem ze zdefiniowaniem selectora
Witam,
Mam konstrukcję w postaci:
<div id="parent">
<p>...</p>
<p>...</p>
<p>...</p>
</div>
Chciałbym aby jaki¶ styl był narzucony od drugiego elementu <p> wzwyż i
tylko dla przypadku gdy rodzicem jes "parent". Zdefiniowałem więc:
#parent p>p
Jednakże to nie działa. Czy wiecie jek to poprawnie zdefiniować?
gefek - 09-02-2010 10:47
In news:news:hklvau$b64$1@achot.icm.edu.pl, Marek wrote:
> Witam,
> Mam konstrukcję w postaci:
> <div id="parent">
> <p>...</p>
> <p>...</p>
> <p>...</p>
> </div>
> Chciałbym aby jaki¶ styl był narzucony od drugiego elementu <p> wzwyż i tylko
> dla przypadku gdy rodzicem jes "parent". Zdefiniowałem więc:
> #parent p>p
> Jednakże to nie działa. Czy wiecie jek to poprawnie zdefiniować?
Może #parent p+p
Działa w przegl±darkach i IE7 w górę.
--
Grzesiek
Marek - 09-02-2010 10:47
No fakt, dzięki :-)
Przyćmiło mnie.
gefek - 09-02-2010 10:47
In news:news:hkmbhi$isv$1@achot.icm.edu.pl, Marek wrote:
> No fakt, dzięki :-)
> Przyćmiło mnie.
W sumie w tym przypadku możesz jeszcze użyć p:first-child żeby zmienić styl
pierwszemu p. Zdaje się że z obsług± jest podobnie jak p+p, pytanie co wygodniej
w konkretnym przypadku.
--
Grzesiek