Re: [WSG] Target 1st item in list

2007-07-27 Thread David Dorward
On 27 Jul 2007, at 00:08, Nick Roper wrote: I need to target the 1st item in a list. http://www.w3.org/TR/CSS2/selector.html#first-child But: http://www.webdevout.net/browser-support-css#css2pseudoclasses -- David Dorward http://dorward.me.uk/ http://blog.dorward.me.uk/

Re: [WSG] Target 1st item in list

2007-07-26 Thread Jason Robb
Perhaps use an adjacent sibling selector: http://www.w3.org/TR/CSS21/selector.html#adjacent-selectors Although I am not sure how stable it is, these might help: Meyer: http://meyerweb.com/eric/css/tests/css2/sec05-07.htm Weakley: http://css.maxdesign.com.au/selectutorial/selectors_adjacent.htm

Re: [WSG] Target 1st item in list

2007-07-26 Thread E Michael Brandt
Given the poor current browser css support for this, perhaps the best thing would be to write a small bit of DOM script that would add a class to that first li for you, on the fly, on page load. It would go something like this: function styleFirstLI(){ // by divaHTML.com var

[WSG] Target 1st item in list

2007-07-26 Thread Nick Roper
I need to target the 1st item in a list. However, to make things complicated I can't assign a class or id to it. This is because of the way that the code is generated. So, given the following example code: h3 class=someClassHeading Text/h3 ul class=someOtherClass liItem 1/li liItem 2/li