12-26-2014, 10:47 PM | #1 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
User agent stylesheet: a proposal
Hi
I spotted an "anomaly" regarding the display of an image and after I checked its CSS with the Inspector, I discovered that this perceived "anomaly" was just the consequence of basic CSS rules. My EPUB had an incorporated but hidden "user agent stylesheet", and one of its values defeated my intended purpose... The only thing is that I was totally unaware of the UA values (here a 8px body margin). I understand that the use of UA stylesheets is widespread and that they are quite useful to provide implicit values when our stylesheets do not provide any. But sometimes, they can give us trouble. 1. Does Calibre adds a "user agent stylesheet" to any EPUB, and if yes, according to which conditions? 2. The Inspector can detect these UA values but its use is not straightforward. Would it be possible to add somewhere a tick mark: "Display the content of user agent stylesheet"? Last edited by roger64; 12-26-2014 at 10:52 PM. |
12-26-2014, 10:57 PM | #2 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Where are you seeing this suer agent stylesheet exactly? Post a screenshot. calibre does not add anything to an EPUB while editing it.
EDIT: If you mean the default styling for elements that have no CSS applied, that is present in all EPUB readers, and its contents vary from reader to reader. It is not inserted into the EPUB, but is instead a property of the reader software. Whenever a HTML renderer encounters an HTML element with no styling applied, its basic style properties are taken from the suer agent stylesheet. Last edited by kovidgoyal; 12-26-2014 at 11:01 PM. |
Advert | |
|
12-27-2014, 12:26 AM | #3 | |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
http://pix.toile-libre.org/?img=1419657539.png The Inspector is the only software which allowed me to understand what was happening. If it can detect these interesting UA values, can it publish them somewhere? Last edited by roger64; 12-27-2014 at 12:29 AM. Reason: link |
|
12-27-2014, 12:45 AM | #4 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There is no point, they are not fixed. They will vary from reader to reader and device to device and software version to software version. What Inspect shows you is particular to that version of WebKit. The values will be different in Adobe Digitqal Edition or indeed any other EPUB reading software.
|
12-27-2014, 02:00 AM | #5 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Thanks for your explanations.
|
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
uninvited "user agent stylesheet" | roger64 | ePub | 2 | 12-26-2014 07:50 PM |
Novice - Need help with user stylesheet | Dan__ | Library Management | 2 | 01-27-2013 05:59 AM |
Browser's User Agent string | Polvo | Kindle Developer's Corner | 0 | 11-18-2010 06:50 AM |
User agent | DigitalDuke | enTourage Archive | 3 | 06-04-2010 03:20 PM |
User Stylesheet for Adobe Digital Editions | wallcraft | ePub | 6 | 09-15-2009 03:53 PM |