| 
			
			 | 
		#1 | 
| 
			
			
			
			 Member 
			
			![]() Posts: 16 
				Karma: 10 
				Join Date: Oct 2020 
				
				
				
				Device: Kindle Oasis 3 
				
				
				 | 
	
	
	
		
		
			
			 
				
				Adding custom code when converting?
			 
			
			
			I convert all my books to KFX to take advantage of the features it provides, however I also like to slightly edit the resulting file. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	html { margin-left: -35px; margin-right: -35px; break-inside: avoid !important } I use the above to push the text closer to the edges of my device, removing empty space, and... body, div, h1, h2, h3, h4, h5, h6, p {orphans: 1 !important; widows: 1 !important; ...the above to remove the resulting extra blank spaces added when converting to KFX, so the text goes from the top right to the bottom of each page. The problem I have is that I add the html manually to the book, then add the CSS when converting which means it takes forever to convert a bunch of books as I have to edit>add code>save for every single one. Is there any way to add both these codes when converting, so that I can just select a handful of books and have these added all at once during conversion? Thanks.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | |
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,215 
				Karma: 8888888 
				Join Date: Jun 2010 
				
				
				
				Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Yes: 
		
	
		
		
			bernie Quote: 
	
  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Member 
			
			![]() Posts: 16 
				Karma: 10 
				Join Date: Oct 2020 
				
				
				
				Device: Kindle Oasis 3 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			This will both remove the blank space as well as add the negative margins? If it only replaces the blank space (like body, div, h1, h2, h3, h4, h5, h6, p {orphans: 1 !important; widows: 1 !important 
		
	
		
		
		
		
		
		
		
		
		
		
		
			 , then I already add the above in the 'extra CSS window.I meant can I also add the HTML during conversion, rather than having to open and edit every individual book and add it manually? EDIT: Actually, just adding both to the 'extra CSS' box appears to actually work, I'll test it on a few and see. I didn't think adding both at the same time would work. Thanks. Last edited by AccidentallyLazy; 07-15-2022 at 08:56 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
    
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Help adding cover_image code | pacha2 | Recipes | 2 | 02-09-2020 04:41 PM | 
| Converting HTML to EPUB - <pre> and <code> issues | csokol | Conversion | 1 | 10-28-2012 11:16 AM | 
| Custom code in ePub titlepage.xhtml | Mrs_Often | Conversion | 6 | 07-24-2012 01:36 PM | 
| Source code for converting html to mobi | Thisiswhatiam | Kindle Formats | 10 | 06-04-2012 03:47 PM | 
| Sigil Automatically Adding Code | christinerose | Sigil | 7 | 04-28-2011 12:07 PM |