Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 12-26-2014, 10:47 PM   #1
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
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.
roger64 is offline   Reply With Quote
Old 12-26-2014, 10:57 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Advert
Old 12-27-2014, 12:26 AM   #3
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by kovidgoyal View Post
Where are you seeing this suer agent stylesheet exactly? Post a screenshot. calibre does not add anything to an EPUB while editing it.
This is a screenshot of this EPUB as displayed using the Calibre editor.

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
roger64 is offline   Reply With Quote
Old 12-27-2014, 12:45 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 12-27-2014, 02:00 AM   #5
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Thanks for your explanations.
roger64 is offline   Reply With Quote
Advert
Reply


Forum Jump

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


All times are GMT -4. The time now is 10:04 AM.


MobileRead.com is a privately owned, operated and funded community.