99problems icon indicating copy to clipboard operation
99problems copied to clipboard

iBooks Desktop wraps naked <img>s in very messy <div>s

Open dvschultz opened this issue 11 years ago • 1 comments

it’s possible this also affects iBooks for iOS, but it’s impossible to test without an inspector.

If you add an <img> into a chapter without it being wrapped in a <figure> (or div?) iBooks for Mavericks will wrap it in a <div>, move your CSS applied to the img to that div and add a host of inline styles to your img

screenshot 2014-06-25 15 13 15

screenshot 2014-06-25 15 20 35

the solution is to wrap it in a div in your xhtml. this will give you more control over its styling and avoid messy inline styling:

screenshot 2014-06-25 15 29 48

dvschultz avatar Jun 25 '14 19:06 dvschultz

actually, upon further inspection, iBooks always does this when an image is set to display: block

dvschultz avatar Jun 27 '14 17:06 dvschultz