View Single Post
Old 12-26-2014, 09:38 AM   #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,625
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
uninvited "user agent stylesheet"

Hi

One friend of mine showed me an illustrated book in odt format so that I could test a converter. I was surprised by the display of some images on the EPUB: it seemed like there was an unexpected added margin around them.

I used the Calibre inspector to check what happened with the CSS. I found that a "user agent stylesheet" had crept in and wrapped a 8px margin around the image. It was unherited from the body value of this uninvited stylesheet.

Mr "User agent" had other ideas too about h2 and h3 like font-size, webkit-margin-(before, after, start, end), font-weight...

I did not have set margin for the body, but nevertheless I found this behaviour very surprising because these foreign values do not appear anywhere in the code. Had not the Inspector been around, I would have been totally puzzled.

How to prevent these "user agent stylesheets" to come in again unexpected and unrequested?
roger64 is offline   Reply With Quote