Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 02-18-2015, 03:12 PM   #1
gezginrocker
Member
gezginrocker began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jan 2015
Device: Kindle
Margin ignored on most readers

Hello,

I'm trying to add some space between titles. I used "margin-top" value at my stylesheet. But when I test ebook with readers like Kindle, Aldiko and Sumatra, I see that margin value is ignored. Only reader correctly displaying margins is Adobe Digital Editions. I tried adding <br> between titles, but the space is too big this way. What is the proper way of doing this?

Thanks
gezginrocker is offline   Reply With Quote
Old 02-18-2015, 03:56 PM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Are you by any chance using "page-break-before: always" or similar in the titles too? Top margins after forced pagebreaks can be discarded according to the spec.
Jellby is offline   Reply With Quote
Old 02-18-2015, 05:18 PM   #3
Section8
Addict
Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.Section8 ought to be getting tired of karma fortunes by now.
 
Section8's Avatar
 
Posts: 254
Karma: 2092424
Join Date: Oct 2011
Location: Arlington, TX
Device: Kindle PW4, Moon+ Reader on a cheap Android tablet
My memory, from a few years ago testing Android epub readers, is that Aldiko is based on ADE and honors CSS margins - unless that's changed in recent versions.

My kindle PW2, definitely does honor css margins with sideloaded azw3 books I've sent it from calibre.
Section8 is offline   Reply With Quote
Old 02-19-2015, 12:39 AM   #4
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
Quote:
Originally Posted by gezginrocker View Post
Hello,

I'm trying to add some space between titles. I used "margin-top" value at my stylesheet. But when I test ebook with readers like Kindle, Aldiko and Sumatra, I see that margin value is ignored. Only reader correctly displaying margins is Adobe Digital Editions. I tried adding <br> between titles, but the space is too big this way. What is the proper way of doing this?

Thanks
Could you give us a look at the relevant CSS and XHTML in your ebooks? Like the others I have no problem with spaces between titles. I think we need more information.
AlexBell is offline   Reply With Quote
Old 02-19-2015, 03:05 AM   #5
gezginrocker
Member
gezginrocker began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jan 2015
Device: Kindle
Hello,

Thanks for all replies. I have limited knowledge of CSS & HTML, probably I'm doing something wrong.

I have created a selector like this at my stylesheet:

.title {
margin-top: 3px;
}


Then I applied the selector like this:

<p class="title"><b>Rafting</b></p>


Thanks
gezginrocker is offline   Reply With Quote
Old 02-19-2015, 03:23 AM   #6
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
There could be other styles with higher priority (in the bookr or implicitly used by the reader) that effectively cancel yours. Do you have other rules in the stylesheet? Are they being honored?

I suggest you use "<h?>" instead of "<p class="title"><b>" (with
an appropriate number between 1 and 6 instead of the ?).
Jellby is offline   Reply With Quote
Old 02-20-2015, 12:28 AM   #7
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
Have you set a top-margin for your pages?

For some reason unknown to me margin-top sometimes does not work to set the top of of a page, but padding-top does. Could you try using padding-top to see if that works?
AlexBell is offline   Reply With Quote
Old 02-21-2015, 04:42 AM   #8
gezginrocker
Member
gezginrocker began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jan 2015
Device: Kindle
Thanks for replies. I tried it like this:

p.title {
padding-top: 0.9em !important;
margin-top: 0.9em !important;
}

Google Books and Adobe Digital Editions does honor, but Kindle & Aldiko still does not. I don't want to use <h?> tags because I am using it with paragraphs as well.
gezginrocker is offline   Reply With Quote
Old 02-21-2015, 07:03 AM   #9
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Something strange is going on here. Can you conjure up an example ePUB with this behavior?
Toxaris is offline   Reply With Quote
Old 02-23-2015, 07:03 AM   #10
gezginrocker
Member
gezginrocker began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jan 2015
Device: Kindle
I found this article at Amazon Kindle Direct Publishing help, maybe this is why margins are not displayed properly.

Margins
At this time, Amazon KDP doesn't support margins set inside CSS/HTML (such as topmargin, leftmargin etc. set in px values). You can use the CSS margin attribute, but depending on your text format, this might not translate properly. Note: You can set only the left, top, and bottom margins this way, never the right margin.
gezginrocker is offline   Reply With Quote
Old 02-23-2015, 09:40 AM   #11
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
That makes sense. Margins in pixels are usually not that useful.
Toxaris is offline   Reply With Quote
Old 02-23-2015, 01:32 PM   #12
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Quote:
Originally Posted by Toxaris View Post
That makes sense. Margins in pixels are usually not that useful.
But they will be in the future when the CSS pixel is adopted and supported in HTML5 and ePub 3.

Dale
DaleDe is offline   Reply With Quote
Old 02-23-2015, 02:14 PM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DaleDe View Post
But they will be in the future when the CSS pixel is adopted and supported in HTML5 and ePub 3.

Dale
But this is KF8, not ePub 3.
JSWolf is offline   Reply With Quote
Old 02-23-2015, 04:22 PM   #14
gezginrocker
Member
gezginrocker began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jan 2015
Device: Kindle
Quote:
Originally Posted by Toxaris View Post
That makes sense. Margins in pixels are usually not that useful.
I used "em" though, but still does not display.
gezginrocker is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS: margin-top and margin Leonatus ePub 16 06-16-2014 04:29 AM
CSS margin instead of margin-top, etc. icallaci Conversion 24 10-19-2013 09:52 AM
@page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } cybmole Conversion 15 02-12-2011 11:57 AM
Margin margin margin Gray Eminence ePub 2 01-10-2011 11:17 AM
calibre ignore margin-top and margin-bottom bender Calibre 2 12-11-2009 06:58 AM


All times are GMT -4. The time now is 06:01 AM.


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