View Single Post
Old 02-27-2011, 02:01 PM   #107
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
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:
  1. suspect human error (faulty syntax, missing punctuation, etc).
  2. check that something else isn't causing the unexpected result.
  3. 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.
  1. 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.
  2. Calibre 0.7.46 does the same with the EPUB file.
  3. 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.
Attached Thumbnails
Click image for larger version

Name:	cssorder3-html-firefox.jpg
Views:	274
Size:	126.9 KB
ID:	67474   Click image for larger version

Name:	cssorder3-html-ie8.jpg
Views:	270
Size:	97.1 KB
ID:	67475   Click image for larger version

Name:	cssorder3-html-sigil.jpg
Views:	258
Size:	116.4 KB
ID:	67476   Click image for larger version

Name:	cssorder3-epub-calibre.jpg
Views:	269
Size:	89.0 KB
ID:	67477   Click image for larger version

Name:	cssorder3-epub-ade.jpg
Views:	264
Size:	65.3 KB
ID:	67478  
Attached Files
File Type: epub cssorder3.epub (2.1 KB, 242 views)
File Type: txt cssorder3.txt (2.6 KB, 314 views)
DMSmillie is offline   Reply With Quote