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/
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
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
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