why not add a class to the p tag? and style with css? On Fri, Oct 1, 2010 at 1:08 PM, Ryan <nun...@gmail.com> wrote:
> CSS does not navigate in reverse. You would need xpath, JavaScript, or > modified HTML structure for what you have described. > > On Oct 1, 2010, at 5:29 AM, Daniel Baars <i...@danielbaars.nl> wrote: > > > Hello, > > > > Is there a way in CSS to match a first element which is the PREVIOUS > > sibling to the second element? > > > > Example: I want to target the paragraph before every header. > > > > <h2>Header</h2> > > <p>First paragraph</p> > > <p>Last paragraph</p> <!-- I want to style this paragraph --> > > <h2>Another header</h2> > > > > After quite a bit of Google-ing it doesn't seem possible but I don't > > understand why. Is this a scenario that I should solve in a more > > intelligent way than I have been able to think of so far? > > > > Cheers, > > > > > > Daniel > > ______________________________________________________________________ > > css-discuss [cs...@lists.css-discuss.org] > > http://www.css-discuss.org/mailman/listinfo/css-d > > List wiki/FAQ -- http://css-discuss.incutio.com/ > > List policies -- http://css-discuss.org/policies.html > > Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ > > ______________________________________________________________________ > css-discuss [cs...@lists.css-discuss.org] > http://www.css-discuss.org/mailman/listinfo/css-d > List wiki/FAQ -- http://css-discuss.incutio.com/ > List policies -- http://css-discuss.org/policies.html > Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ > ______________________________________________________________________ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/