View Single Post
Old 07-31-2015, 04:41 AM   #1
ButWhy
Junior Member
ButWhy began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2015
Device: EPUB & MOBI
Question CSS: Margin vs. Padding

Forgive me if I'm posting this question in the wrong place. Will some helpful mod please move me if necessary?

Here's my issue. I just ran into a situation where the EPUB I'm building (in Sigil 0.8.6) rendered perfectly in ADE, Nook for PC, and Aldiko (with publisher settings selected). I validated the EPUB itself with flightcrew and idpf. I mushed the CSS through the w3s validator. All was good.

...and then came Nook for Android. None of the CSS that involved the margin property would stick, so the spacing (margin-top or margin-bottom) did not render. After googling for a geological age to find out why, I finally ended up changing all my "margin-bottom:1em;" to "padding-bottom:1em;".

The good news: The spacing works in the Nook for Android app, ADE and all the rest. (Also successfully converted to MOBI courtesy of KindleGen.)

But of course now I'm wondering what sort of minefield I've just built for myself, so I have come crying to you guys in the hopes that

a) Someone can explain why Nook-for-Android app can't play nice with the other children when it comes to the margin property

b) What I need to watch out for when using the padding property instead of margin. What's the difference between the two, really?



I sincerely appreciate any insight on this. Man, this stuff is confusing sometimes.
ButWhy is offline   Reply With Quote