| 
			
			 | 
		#256 | |
| 
			
			
			
			 US Navy, Retired 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,897 
				Karma: 13806776 
				Join Date: Feb 2009 
				Location: North Carolina 
				
				
				Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#257 | |
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 2 
				Karma: 10 
				Join Date: Nov 2019 
				
				
				
				Device: pc 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Finally i took your background image, which is great too. I just modified it a little to simulate a book that suits me better. I put also the croped background i wanted to use initially. And i use this css Code: 
	body{
 margin-top: 0.15em !important;
}
p{
 margin-bottom: 0.3em !important; 
 margin-left:   6.5em !important;
 margin-right:  6.5em !important;
}
h2,h3,h4,h5,h6{
 margin-left: 4.5em !important;
}
I hope in a future update we can deal with the body margin, that would solve all these problems    Anyway thanks for this great software and thank you Doc for your time responding to me.
		 | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#258 | 
| 
			
			
			
			 Connoisseur 
			
			![]() Posts: 60 
				Karma: 10 
				Join Date: Sep 2017 
				
				
				
				Device: PocketBook 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			It's possible, with the latest release, to customize also the "upper" row (id=book-top-margin)? I tried this, but unsuccessfully: 
		
	
		
		
		
		
		
		
		
		
		
		
	
	#book-top-margin {background-color: gray !important; color: rgb(252, 252, 252) !important;}  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#259 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			margins take the same color as whatever backgroud color you have defined in the coor preferences for the viewer.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#260 | |
| 
			
			
			
			 Connoisseur 
			
			![]() Posts: 60 
				Karma: 10 
				Join Date: Sep 2017 
				
				
				
				Device: PocketBook 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Yes, but why not let to customer ... customize that colors (with css)? Last edited by duns; 12-20-2019 at 04:51 AM.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#261 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Because I dont see the point, why would anyone want margins in a different color from the page? And if you really do, the set the page color to what you want the margins to be and use an image as the page background.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#262 | |
| 
			
			
			
			 Connoisseur 
			
			![]() Posts: 60 
				Karma: 10 
				Join Date: Sep 2017 
				
				
				
				Device: PocketBook 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 I simply ask you to give the possibility, if a css expert customer wants, to differentiate that background (css ID #book-top-margin).  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#263 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			That is the top margin, and is it is separated by whitespace from the text of the book, just as in all paper books for instance. You can control how much space there is yby changing the size of the margin.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#264 | |
| 
			
			
			
			 Connoisseur 
			
			![]() Posts: 60 
				Karma: 10 
				Join Date: Sep 2017 
				
				
				
				Device: PocketBook 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 We are not all "made in the same way"   : personally I would prefer to see "author" and "title" and "chapter" with a background that distinguishes it from the body of the text. Is would be technically difficult to let users (with css knowlegde) customize this background?  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#265 | |
| 
			
			
			
			 US Navy, Retired 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,897 
				Karma: 13806776 
				Join Date: Feb 2009 
				Location: North Carolina 
				
				
				Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Last edited by DoctorOhh; 12-20-2019 at 06:38 PM.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#266 | |
| 
			
			
			
			 Connoisseur 
			
			![]() Posts: 60 
				Karma: 10 
				Join Date: Sep 2017 
				
				
				
				Device: PocketBook 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Today I managed to get something similar (see the image attached), but now Calibre viewer is become very slow... EDIT No: I have changed something and now the speed is normal. This is my css code: Code: 
	body {
  counter-reset: section;  /* Set a counter named 'section', and its initial value is 0. */
  background-image: radial-gradient(white 20%, #e5e4dc 70%) !important;
}
h2 {
  counter-reset: paragraph;    /* Set a counter named 'section', and its initial value is 0. */
  counter-increment: section; /* Increment the value of section counter by 1 */
}
p::before {
     counter-increment: paragraph;       /* Increment the value of parag counter by 1 */
     content: "[cap." counter(section) ", para." counter(paragraph) "] "; 
     color: gray; font-size: 70%;
}
h2 {background: #B35A31 linear-gradient(to left, #B35A31 80%, #F4E492 105%); color: white !important; font-weight: bold !important; text-shadow: gray -1px -1px;  border-radius: 8px; box-shadow: 5px 4px 4px gray;  margin-bottom: 25px !important;}
h3, h4 {color: #B35A31 !important; border-bottom: thin white solid;}
div {max-width: 90vw !important; margin-left: auto; margin-right: auto;}
Last edited by duns; 12-21-2019 at 06:30 AM.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#267 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			What size image are you using for the background?
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		
 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#268 | 
| 
			
			
			
			 Connoisseur 
			
			![]() Posts: 60 
				Karma: 10 
				Join Date: Sep 2017 
				
				
				
				Device: PocketBook 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#269 | 
| 
			
			
			
			 Guru 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 922 
				Karma: 810834 
				Join Date: Sep 2017 
				Location: Buenos Aires, Argentina 
				
				
				Device: moon+ reader, kindle paperwhite 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#270 | 
| 
			
			
			
			 US Navy, Retired 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,897 
				Karma: 13806776 
				Join Date: Feb 2009 
				Location: North Carolina 
				
				
				Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			No special code. I described how I set things up in post 246.  But I attached the adjustments I entered in Viewer - Preferences to get this look. Essentially no margins left, right or bottom. Change the color so the background and fore a different then add code in style to change the book text color back to black. 
		
	
		
		
			In calibre preferences I did create a Save to Disk metadata plugboard (see attached) to save the Author - Title to the title field upon using the Save to Disk feature to get the Author and title to display where only the Title would normally appear. This means I would have to use the Save to Disk feature to save the book into a reading directory before I read the book. This was just an exercise to show what could be done with existing settings. I use the setup in post 246 myself. Last edited by DoctorOhh; 12-30-2019 at 05:36 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
            
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Custom CSS for output | deckoff | Calibre | 1 | 08-29-2010 12:55 AM | 
| ePub with custom .css on a 505 | dicknskip | Sony Reader Dev Corner | 3 | 06-10-2010 12:34 AM | 
| User stylesheets for ePub files | salty-horse | Sony Reader Dev Corner | 12 | 02-23-2010 08:44 AM | 
| ePub conversion: override existing css with a custom one | sbin | Calibre | 1 | 01-09-2010 05:03 AM | 
| Calibre's generated css for epub | brewt | Calibre | 7 | 12-29-2008 10:59 AM |