Re: [css-d] first-child pseudo-class on a class-level
On Dec 7, 2010, at 2:48 AM, Dave Solko wrote: >> Given the document structure above, maybe .description + .leading { >> background: red } ? > > > Then perhaps I should rephrase the question. Is there any way, given the > existing HTML to address the first independently of the > others? (in reality, there's 4 'leadings') Does my suggestion above not work for you ? Philippe --- Philippe Wittenbergh http://l-c-n.com/ __ 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/
Re: [css-d] first-child pseudo-class on a class-level
On Dec 5, 2010, at 11:18 PM, Philippe Wittenbergh wrote: On Dec 6, 2010, at 12:59 PM, Dave Solko wrote: I'm trying to apply :first-child to an element with a class. It only needs to work in safari (intranet). I'm using Joomla, so changing the html isn't really an option. Can it be done? I've been trying variations on: .leading:first-child { border-top: 1px solid #ccc; border-top-left-radius: 8px; border-top-right-radius: 8px; } ... resources foo lorem ipsum dolor sit amet... bar lorem ipsum dolor sit amet... In your case, the div with class .leading is definitely not the first-child (it is the second, third, ... child of div.content). And remember: those structural pseudo-classes count *elements*, then checks if they have a class, etc. Given the document structure above, maybe .description + .leading { background: red } ? Philippe --- Philippe Wittenbergh http://l-c-n.com/ Then perhaps I should rephrase the question. Is there any way, given the existing HTML to address the first independently of the others? (in reality, there's 4 'leadings') Dave Solko Pixel Alchemy d...@pixelalchemy.com 513.300.2165 __ 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/
Re: [css-d] first-child pseudo-class on a class-level
On Dec 6, 2010, at 12:59 PM, Dave Solko wrote: > I'm trying to apply :first-child to an element with a class. It only needs to > work in safari (intranet). I'm using Joomla, so changing the html isn't > really an option. Can it be done? > > I've been trying variations on: > .leading:first-child { > border-top: 1px solid #ccc; > border-top-left-radius: 8px; > border-top-right-radius: 8px; > } > > > ... > > >resources > > >foo >lorem ipsum dolor sit amet... > > >bar >lorem ipsum dolor sit amet... > > > In your case, the div with class .leading is definitely not the first-child (it is the second, third, ... child of div.content). And remember: those structural pseudo-classes count *elements*, then checks if they have a class, etc. Given the document structure above, maybe .description + .leading { background: red } ? Philippe --- Philippe Wittenbergh http://l-c-n.com/ __ 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-d] first-child pseudo-class on a class-level
I'm trying to apply :first-child to an element with a class. It only needs to work in safari (intranet). I'm using Joomla, so changing the html isn't really an option. Can it be done? I've been trying variations on: .leading:first-child { border-top: 1px solid #ccc; border-top-left-radius: 8px; border-top-right-radius: 8px; } ... resources foo lorem ipsum dolor sit amet... bar lorem ipsum dolor sit amet... ... Dave Solko Pixel Alchemy d...@pixelalchemy.com 513.300.2165 __ 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/