Re: [WSG] why :first-child pseudo-class doesn't work for some selectors/elements?

2011-03-06 Thread Susanne Jäger
Am 06.03.2011 11:03 schrieb tee: http://jsbin.com/apate4/9/ According to the spec, it should work. The :first-child pseudo-class represents an element that is the first child of some other element. http://www.w3.org/TR/css3-selectors/#first-child-pseudo that means first child of any type

Re: [WSG] why :first-child pseudo-class doesn't work for some selectors/elements?

2011-03-06 Thread David Dorward
Because those elements are not the first child element in their respective containers. On 6 Mar 2011, at 10:03, tee wrote: http://jsbin.com/apate4/9/ dt, dd { border-top:1px solid #555;float:left } dt:first-child {border-top:0} dd:first-child {border-top:0} !-- Container -- dl !--

Re: [WSG] why :first-child pseudo-class doesn't work for some selectors/elements?

2011-03-06 Thread Oliver Boermans
An alternative to get the first dd in a dl: :first-child + dd { ... } I'm not sure how browser support for '+' compares to 'first-of-type'. Cheers Ollie -- @ollicle On 06/03/2011, at 20:33, tee weblis...@gmail.com wrote: http://jsbin.com/apate4/9/ dt, dd { border-top:1px solid

Re: [WSG] why :first-child pseudo-class doesn't work for some selectors/elements?

2011-03-06 Thread tee
I see! In the entire time I thought this applies to any first child of p, and so are for the first h2 and first dd in any give page if first-child is declared. p:first-child p The last P before the note./p div class=note h2 Note /h2 p The first P inside the note./p /div How

RE: [WSG] why :first-child pseudo-class doesn't work for some selectors/elements?

2011-03-06 Thread Thierry Koblentz
An alternative to get the first dd in a dl: :first-child + dd { ... } That would not be a sure thing as this could match a dt too -- Regards, Thierry @thierrykoblentz www.tjkdesign.com | www.ez-css.org | www.css-101.org

RE: [WSG] why :first-child pseudo-class doesn't work for some selectors/elements?

2011-03-06 Thread Thierry Koblentz
An alternative to get the first dd in a dl: :first-child + dd { ... } That would not be a sure thing as this could match a dt too Scratch that, I didn't have my coffee yet ;) -- Regards, Thierry @thierrykoblentz www.tjkdesign.com | www.ez-css.org | www.css-101.org

Re: [WSG] why :first-child pseudo-class doesn't work for some selectors/elements?

2011-03-06 Thread tee
The example below is something I constantly seeing, should have gone testing it again making sure my memory is still fresh, but I am a bit lazy right now as I haven't had my coffee yet. The :first-child pseudo-class represents an element that is the first child of some other element.. I have

RE: [WSG] why :first-child pseudo-class doesn't work for some selectors/elements?

2011-03-06 Thread Thierry Koblentz
The :first-child pseudo-class represents an element that is the first child of some other element.. I have often used li:first-child or li a:first child in different section of a page, why is that I can get the first-child in, say, #hdr li:first-child .sidebox li:first-child (and it

Re: [WSG] why :first-child pseudo-class doesn't work for some selectors/elements?

2011-03-06 Thread Rob Crowther
On 06/03/11 20:22, tee wrote: but I can never get h2:first-child works Here's an example, specifically using h2 elements since you mentioned them: http://www.boogdesign.com/examples/css3/first-child.html By default, every element has a blue border, but any element which is a :first-child

RE: [WSG] why :first-child pseudo-class doesn't work for some selectors/elements?

2011-03-06 Thread Birendra
Hi Tee Please use div/div tag in your coding. As your css is right but it's not effected till you didn't mention the parent :) Example: div h2Heading 2 this is the first-child and the bg color should be in Olive./h2 h2Another Heading 2 - this /h2 pThis is paragraph and first-child so