OK... sorry for the delay in replying to your post (#103) cybmole. Had to spend time on other stuff for much of today.
I'm going to have to amend this bit of my understanding of how CSS works in practice.
When something I'm working on goes against what I'd expect to see, I:
- suspect human error (faulty syntax, missing punctuation, etc).
- check that something else isn't causing the unexpected result.
- create a test file that isolates the suspected cause, so that I can test if that's really what's causing it, beyond any doubt.
I apply this process to my own work, as well as to what others are working on. From the posts you wrote yesterday, cybmole, it seemed like you were changing lots of stuff in the HTML and CSS, but only copying and pasting a small fragment of each in your posts here, so it wasn't possible for me or theducks to check a or b. I suggested you create a test file to verify what was happening. I've done that today, so we can all be clear on what's going on.
- Firefox 3.6, Internet Explorer 8 and Sigil 0.3.2 all appear to rely on the order in which the CSS styles occur in the stylesheet, and ignore the order in which the classes are listed in the CLASS attribute.
- Calibre 0.7.46 does the same with the EPUB file.
- Adobe Digital Editions 1.7, however, does the opposite - it ignores the order in which the styles are listed in the stylesheet, and relies on the order in which the classes are listed in the CLASS attribute.
So... it would seem that the best approach would be to do both - ensure that, in the style sheet, more general styles come first, followed by specific variations, and, in the HTML, list multiple classes starting with the more general and ending with those relating to specific variations on the general style.
I'm really
really surprised by this. You seemed to think, cybmole, that theducks and I were just tossing out info we weren't sure of as if it was hard fact, but I
never say "xyz is true" unless I got the info from an excellent authority or verified it for myself - if I'm unsure about something, I say so (and while I don't want to put words into someone else's mouth, I'm pretty sure theducks would say the same thing).
I'm sorry that it turns out we were misleading you on this one, cybmole. I'm still trying to figure out if I always had this wrong, or if something changed at some point in how CSS is handled, and I simply never picked up on it.
I've attached the following files:
- The test HTML file I created (uploaded as a text file).
- The resulting EPUB file.
- Screenshots of how these files display in the applications I listed above.