Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-09-2009, 02:03 AM   #1
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,150
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
css override code for margins?

Hi,

I'm not sure what code to use in the override box to get the page to use my margins instead of the settings in Calibre?

I'm trying to get the top and bottom margin down to 0.

I'd appreciate any and all help.

Thanks
Amalthia is offline   Reply With Quote
Old 08-09-2009, 07:56 AM   #2
Nate the great
Sir Penguin of Edinburgh
Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.
 
Nate the great's Avatar
 
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
It should look something like the following (change the numbers to suit your preferences):

body {
margin-left:0;
margin-right:0;
margin-top:0;
margin_bottom:0;
}
Nate the great is offline   Reply With Quote
Advert
Old 08-09-2009, 05:01 PM   #3
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,150
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by Nate the great View Post
It should look something like the following (change the numbers to suit your preferences):

body {
margin-left:0;
margin-right:0;
margin-top:0;
margin_bottom:0;
}
Thanks!
Amalthia is offline   Reply With Quote
Old 08-10-2009, 02:08 PM   #4
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,150
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by Nate the great View Post
It should look something like the following (change the numbers to suit your preferences):

body {
margin-left:0;
margin-right:0;
margin-top:0;
margin_bottom:0;
}

I tried that code but it didn't seem to affect the bottom and top margins. I tried

p {margin-left:0;
margin-right:0;
margin-top:0;
margin_bottom:0;}

and that seemed to work better. Not sure if it's proper coding or not but at least I no longer have 1 inch margins at the bottom of my files.
Amalthia is offline   Reply With Quote
Old 08-10-2009, 04:06 PM   #5
Nate the great
Sir Penguin of Edinburgh
Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.
 
Nate the great's Avatar
 
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
Oops. You caught a typo. I wrote margin_bottom; it should read margin-bottom.
Nate the great is offline   Reply With Quote
Advert
Old 08-10-2009, 05:17 PM   #6
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,150
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by Nate the great View Post
Oops. You caught a typo. I wrote margin_bottom; it should read margin-bottom.

that may explain why the code didn't work...
Amalthia is offline   Reply With Quote
Old 08-11-2009, 12:28 AM   #7
slantybard
my parent's oops...
slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.
 
Posts: 463
Karma: 1477570
Join Date: Feb 2009
Device: Vx->Handera->Clie-> Axim->505->650->KPW/Aura ->iOS/L2
I use:

Code:
p {
  margin-top: 0pt; margin-bottom:0pt;padding:0pt; text-indent:20pt
}
and I leave the margins on the page setup dialog all as 0.0.
slantybard is offline   Reply With Quote
Old 08-11-2009, 02:55 PM   #8
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,150
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by Nate the great View Post
Oops. You caught a typo. I wrote margin_bottom; it should read margin-bottom.
I'm a bit confused, in almost all css codes I've looked at you it seems like you're supposed to end properties with a colon, but on this one code you end with a period?

is the body selector just different from other selectors? Or is there more going on?

And is

body {margin-left:0;
margin-right:0;
margin-top:0;
margin_bottom.0;}

more correct than

p {margin-top: 0pt; margin-bottom: 0pt; padding: 0pt;
text-indent: 15pt;}

Last edited by Amalthia; 08-11-2009 at 02:59 PM.
Amalthia is offline   Reply With Quote
Old 08-11-2009, 02:59 PM   #9
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,150
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by slantybard View Post
I use:

Code:
p {
  margin-top: 0pt; margin-bottom:0pt;padding:0pt; text-indent:20pt
}
and I leave the margins on the page setup dialog all as 0.0.
I've started doing the same. Still not sure what the difference is between body and p but p seems to work.
Amalthia is offline   Reply With Quote
Old 08-11-2009, 03:05 PM   #10
Nate the great
Sir Penguin of Edinburgh
Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.
 
Nate the great's Avatar
 
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
Quote:
Originally Posted by Amalthia View Post
I'm a bit confused, in almost all css codes I've looked at you it seems like you're supposed to end properties with a colon, but on this one code you end with a period?

is the body selector just different from other selectors? Or is there more going on?

And is

body {margin-left:0;
margin-right:0;
margin-top:0;
margin_bottom.0;}

more correct than

p {margin-top: 0pt; margin-bottom: 0pt; padding: 0pt;
text-indent: 15pt;}
I ended the sentence with the period; it was not part of the css term.
Nate the great is offline   Reply With Quote
Old 08-11-2009, 03:16 PM   #11
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,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Amalthia View Post
I'm a bit confused, in almost all css codes I've looked at you it seems like you're supposed to end properties with a colon, but on this one code you end with a period?
Property name and value must be separated by a colon (consider it like a = sign). After the value, a semicolon is needed; it is optional just before the closing brace, but it's safest to always add it.

Quote:
And is

body {margin-left:0;
margin-right:0;
margin-top:0;
margin_bottom.0;}

more correct than

p {margin-top: 0pt; margin-bottom: 0pt; padding: 0pt;
text-indent: 15pt;}
0 and 0pt are the same, when the value is 0 you don't need to specify the units. body and p are different elements (p is inside body), so modifying them can give different results. You probably want both things, I'd use:

Code:
body { margin: 0; }
p { margin: 0; padding: 0; text-indent: (whatever); }
Jellby is offline   Reply With Quote
Old 08-11-2009, 04:01 PM   #12
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,150
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by Nate the great View Post
I ended the sentence with the period; it was not part of the css term.

okay to be absolutely clear this is the correct css code?

body {margin-left:0;
margin-right:0;
margin-top:0;
margin_bottom.0
}

I'm still confused if this is correct as to why you would not have a semicolon at the end of margin_bottom.0
Amalthia is offline   Reply With Quote
Old 08-11-2009, 04:02 PM   #13
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,150
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by Jellby View Post
Property name and value must be separated by a colon (consider it like a = sign). After the value, a semicolon is needed; it is optional just before the closing brace, but it's safest to always add it.



0 and 0pt are the same, when the value is 0 you don't need to specify the units. body and p are different elements (p is inside body), so modifying them can give different results. You probably want both things, I'd use:

Code:
body { margin: 0; }
p { margin: 0; padding: 0; text-indent: (whatever); }
I'll try that out and see what happens.

Thanks!
Amalthia is offline   Reply With Quote
Old 08-11-2009, 04:36 PM   #14
Nate the great
Sir Penguin of Edinburgh
Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.
 
Nate the great's Avatar
 
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
Quote:
Originally Posted by Amalthia View Post
okay to be absolutely clear this is the correct css code?

body {margin-left:0;
margin-right:0;
margin-top:0;
margin_bottom.0
}

I'm still confused if this is correct as to why you would not have a semicolon at the end of margin_bottom.0
No, that's wrong. don't understand why you removed the semicolon but left the period.

I also don't understand why you think I dropped the semicolon. I didn't. Go look at my first post in this thread. The only error in it is that I used an underscore instead of a dash.
Nate the great is offline   Reply With Quote
Old 08-11-2009, 04:40 PM   #15
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,510
Karma: 126422064
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
The correct code is....

Code:
body {
   margin-left: 0;
   margin-right: 0;
   margin-top: 0;
   margin-bottom: 0;
}
p {
   text-indent: 1.1em
}
JSWolf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedding Chinese font using CSS override? kome17 Calibre 0 09-18-2009 12:57 AM
IMG css override not working anymore? Amalthia Calibre 10 08-03-2009 01:12 AM
help with Claibre CSS override sideburnt Calibre 7 05-28-2009 08:25 PM
centering images with css override? Amalthia Calibre 2 03-30-2009 01:53 PM
css override code for <h2> and <h1> tags Amalthia Calibre 2 03-29-2009 06:51 PM


All times are GMT -4. The time now is 03:52 AM.


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