Note however, that a CSS background image is semantically different to an <img> element (for instance, a background image will be completely ignored by a screen reader). Whether the former or the latter is more appropriate depends on the use case, i.e. whether the image should convey any meaning, or is just for decorative purposes.Ludwig wrote:Possibly this is an option via css nth-child
I presume there is no solution for AdvancedTOC with CSS only; the :contains() pseudo class has been removed from the Selectors Level 3 specification. I don't know whether :contains() is supported by any browser or whether it will be (or even is already) standardized somewhere else. You could work around that with JavaScript, though.bastingse wrote:The only thing that i client can't do is add some pages (h1) in between..... Should there be a solution for that problem?
Anyhow, it occurs to me the cleanest solution would be the possibility to add an individual CSS class to certain menu items, and to use this class as (part of) the selector. This way it might be possible to add a background image for this selector and to adjust the height of the menu item respectively, so the image is displayed above the actual menu item. The classic xTOC supports that via mode 2.
An alternative might be Toxic_XH which I have just released as alpha version. It allows to set individual CSS classes for any page, so you have the same option as with classic xTOC mode 2. Furthermore it allows to use arbitrary (X)HTML markup for the category, so you could define an <img> there (wouldn't work for multilingual installations, though).