| 
			
			 | 
		#1 | 
| 
			
			
			
			 Guru 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 793 
				Karma: 1538394 
				Join Date: Sep 2013 
				
				
				
				Device: Kobo Sage 
				
				
				 | 
	
	
	
		
		
			
			 
				
				What is page_styles.css for?
			 
			
			
			I'm assuming the various forms of page_styles.css I'm seeing (page_styles.css, page_styles1.css and page_styles3.css) in my epubs are there from Calibre's conversion process since they're present in every file.  Purely out of curiosity, I'm wondering why they're their at all.  Invariably, all that's in those files is: 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Code: 
	@page { margin-top: 0; margin-left: 0; margin-right: 0; margin-bottom: 0; }
 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Well trained by Cats 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,267 
				Karma: 61916422 
				Join Date: Aug 2009 
				Location: The Central Coast of California 
				
				
				Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Sort of what it says  overall PAGE 
		
	
		
		
		
		
		
		
		
		
		
		
	
	You are not limited to a single style sheet in a book. Different sections may have different stylesheets Pagestyles is the common bit. It may include @fonts  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Resident Curmudgeon 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,782 
				Karma: 150249619 
				Join Date: Nov 2006 
				Location: Roslindale, Massachusetts 
				
				
				Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			What I do is combine the CSS. I cannot stand multiple CSS files. An omnibus can be really bad in that regard as each book can have it's own CSS. That means each book in the omnibus could be formatted differently instead of done correctly with the same formatting (where possible) for each book.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | |
| 
			
			
			
			 Well trained by Cats 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,267 
				Karma: 61916422 
				Join Date: Aug 2009 
				Location: The Central Coast of California 
				
				
				Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Rule #1: If it works... SHIP IT!  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | |
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,688 
				Karma: 9500498 
				Join Date: Sep 2021 
				Location: Australia 
				
				
				Device: Kobo Libra 2 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 (Don't forget to relink the new stylesheet which also clears out the redundant entries) I assume that multiple css files are for human readability, not machine readability.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#6 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			page_styles.css contain @page and @font-face rules. These cannot be applied with selectors therefore they cannot be in a common stylesheet, since different html files might need different values for them. THerefore there is one page_styles.css for every individual HTML file that needs different values for page margins, embedded fonts, etc.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#7 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,688 
				Karma: 9500498 
				Join Date: Sep 2021 
				Location: Australia 
				
				
				Device: Kobo Libra 2 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#8 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			calibre conversion already only uses different page_styles.css files if they are actually needed.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#9 | 
| 
			
			
			
			 Guru 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 793 
				Karma: 1538394 
				Join Date: Sep 2013 
				
				
				
				Device: Kobo Sage 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			The odd thing is that I've never seen anything in those page_styles.css files except an @page with all margins 0.  Lately, I've been working on reformatting my copies of Rex Stout's "Nero Wolfe" series.  Those books contained 2-3 page_styles[n].css files that were always the same (I assume I must have done multiple conversions on them over the years to cause that).  Since each file also contained stylesheet.css with all the actual formatting, I just removed the links to the page_styles versions and deleted those files. 
		
	
		
		
		
		
		
		
		
		
		
		
		
			EDIT: I think I've figured out what's happened with these. One of the first things I do is use Modify ePub on my books and remove all embedded fonts. I'll bet those fonts were referenced in the page_styles.css file. Once the fonts were gone, the page_styles.css files were left with nothing but the zero-margin @page. Last edited by enuddleyarbl; 07-16-2022 at 09:41 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
    
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Customize viewer css. pygments.css not found | drglenn | Viewer | 2 | 12-18-2020 05:52 PM | 
| ebook-convert problem with page_styles.css | gogu1904 | Conversion | 4 | 08-30-2020 04:34 AM | 
| pagestyle.css extra / integrated in stylesheet.css / or not at all? | chaot | Workshop | 14 | 02-25-2017 12:10 AM | 
| when does calibre add/not add page_styles css | cybmole | Calibre | 5 | 07-14-2014 04:58 AM | 
| css pseudo elements and adjacent combinators in extra css? | ldolse | Calibre | 2 | 12-21-2010 06:09 PM |