On Mar 5, 2010, at 7:18 PM, Sjur Moshagen wrote:
> I'm trying to style XML with CSS. I have successfully used the :only-of-type
> pseudo-class to let single instances of an element become inline, and
> multiple instances of the same be block elements.
>
> What I am NOT able to do is to combine this pseudo-class with the :before
> pseudo-class.
>
> What I want to achieve is:
> * multiple children of the same type should be displayed as a numbered list
> * lone children of the above type should be displayed as inline text,
> *without* any numbering
>
> Since i'm not able to combine the :before element with any variant of pseudo
> selectors that would differentiate between the two cases, I'm not able to
> remove the numbering from the single child case (or add it only to the
> multiple children case).
>
> The present state can be seen at:
>
> https://victorio.uit.no/langtech/trunk/words/dicts/nobfkv/src/adv_nobfkv.xml
E:only-of-type::before {content: none; content:''; } should work correctly. In
Safari 4,Chrome 4, Opera 10.5, Gecko 1.9.2. Forget about IE, it doesn't
understand 'only-of-type'.
I don't think working with counters() would produce different results.
testcase:
http://dev.l-c-n.com/_temp/only-of-type-cssD220305.html
note: neither WebKit nor Opera support 'content: none', hence the double
declaration.
otherwise you could also do E:not(only-of-type)::before {content:'something'}
I don't have time to wade through your whole stylesheet / page. A simplified
test case please ?
Philippe
---
Philippe Wittenbergh
http://l-c-n.com/
______________________________________________________________________
css-discuss [[email protected]]
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/