| 
			
			 | 
		#1 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 4 
				Karma: 10 
				Join Date: Jun 2017 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
			
			 
			
			Hey, I've defined a stylesheet that I really like and want to use in my books.  I want to use it pretty much for everything. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	However, I've noticed that as I work on files in Book View, Sigil tends to add its own styles to my text. At best, this results in things like font-size attributes being added to <p> tags. Sometimes it adds spurious <span>s, looking like: <span style="font-size: 16px; line-height: 1.5em;"> These attributes generally match the ones in my stylesheet, so there's no problem in terms of display usually. But I don't want it to add them, it increases file size and makes it harder to work with the code! And sometimes it uses a <div> instead of a <p>, and I'd really like it not to do that. What am I doing wrong? Is there some setting I can use to get it to use the simplest code possible? I scanned through the FAQ in the Sigil user guide and the first couple of pages of topics here in the forum and didn't see anything that applies to the issue, so my apologizes if this is something that's been covered before that everyone knows the answer to.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520 
				Karma: 121692313 
				Join Date: Oct 2009 
				Location: Heemskerk, NL 
				
				
				Device: PRS-T1, Kobo Touch, Kobo Aura 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			The answer is very simple actually. Stop using Book View and only use Code View. You have all the control and none of the unwanted conversions. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	You can use the Preview panel to get an idea how it will look instead of the Book View.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 mostly an observer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,519 
				Karma: 996810 
				Join Date: Dec 2012 
				
				
				
				Device: Kindle 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Preview Panel sometimes overlays Code View, so you have to grab the bar at the top of it and tertivate it. After an agonizing while, you'll hit it just right and pop! you will have three panels in a row: Book Browser, Code View, and Preview Panel. Now there's no reason ever to use Book View, because you've got a permanent WYSIWYG display sitting there on the right. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	(Well, you can't test the TOC in Preview Panel, so you might want to call up Book View for that.) Other stuff can creep in. I often get a few faux hyperlinks in a book file, probably created by Word somehow. And recently I discovered that a book (maybe all my books?) was full of invisible soft hyphens, so I had to make them visible (­   in order to delete them. And yes, rarely, Sigil will create a new style if you are pushing inline styling too far; it prefers that there be a class for it, so creates one at the top of that particular file and will repeat it every time you split off a new file. You can either leave them be or add it to your style sheet.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | |
| 
			
			
			
			 A Hairy Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,397 
				Karma: 20212733 
				Join Date: Dec 2012 
				Location: Charleston, SC today 
				
				
				Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | 
| 
			
			
			
			 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 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#6 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,891 
				Karma: 207182180 
				Join Date: Jan 2010 
				
				
				
				Device: Nexus 7, Kindle Fire HD 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			You're mistaken. The current Sigil has no such "preference." You're describing the behavior attributed to HTMLTidy and older versions of Sigil. The current Sigil's Book View WILL create inline styles when editing, but it will NOT create css in the header section of xhtml files. That particular quirk went away with Tidy.
		 
		
	
		
		
		
		
		
		
		
		
		
		
		
			Last edited by DiapDealer; 06-04-2017 at 11:35 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#7 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,891 
				Karma: 207182180 
				Join Date: Jan 2010 
				
				
				
				Device: Nexus 7, Kindle Fire HD 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Except when you don't know how (or want) to write xhtml/css and you rely on a WYSIWYG editor to automatically write the code that produces the typographical effect you desire FOR you. Then ... you takes what what you gets.
		 
		
	
		
		
		
		
		
		
		
		
		
		
		
			Last edited by DiapDealer; 06-04-2017 at 01:21 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#8 | 
| 
			
			
			
			 A Hairy Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,397 
				Karma: 20212733 
				Join Date: Dec 2012 
				Location: Charleston, SC today 
				
				
				Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#9 | 
| 
			
			
			
			 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 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#10 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,891 
				Karma: 207182180 
				Join Date: Jan 2010 
				
				
				
				Device: Nexus 7, Kindle Fire HD 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			If you wish to have a discussion damning/praising the use of inline styles, feel free to start a thread about it in the Epub, or Workshop forum.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#11 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 4 
				Karma: 10 
				Join Date: Jun 2017 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Ah, thanks for the info.  I was afraid this might be the case.  Use Code View and stare at markup when you just want to write, or use Book View and risk having it capriciously adding superfluous code.  Yay.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#12 | |
| 
			
			
			
			 Bookmaker & Cat Slave 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503 
				Karma: 158448243 
				Join Date: Apr 2010 
				Location: Phoenix, AZ 
				
				
				Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Sigil is not, nor does it pretend to be, an authoring tool or an word-processor. It is neither. It's not intended to be used, "to write." The intent is that you'll use a tool intended to write, for writing, and then, when done, you'll export that to HTML, and then put that HTML into Sigil to make into an ePUB. It's unfortunate that it doesn't work the way that you want, but you are using it outside of its intended and designated use. Hitch  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#13 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,891 
				Karma: 207182180 
				Join Date: Jan 2010 
				
				
				
				Device: Nexus 7, Kindle Fire HD 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			The "I don't want to have to deal with code; except that I want the code (that I don't want to deal with) to look a particular way" mindset always confuses me a bit.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#14 | 
| 
			
			
			
			 Fanatic 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 531 
				Karma: 10000000 
				Join Date: Aug 2013 
				Location: Hamden, CT 
				
				
				Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			There are HTML display engines with bugs.  One of them ignores <style> elements. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	So, for this HTML engine, if you want to do a quick one-off styling, you have to use inline styles. The only time I have found it really matters is in the cover page created by Calibre, which uses the <style> element at the top of the page to center the image. Every EPUB I clean up, I do so with least-common-denominator HTML and CSS, so that it works on the widest possible number of devices/engines. I lose a few things I would like to have, but none are very crucial.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#15 | 
| 
			
			
			
			 Junior Member 
			
			![]() Posts: 4 
				Karma: 10 
				Join Date: Jun 2017 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Yeah yeah sure.  Thing is though: 
		
	
		
		
		
		
		
		
		
		
		
		
		
			1. When I write in some word processor and paste into Sigil, which I imagine is using it as intended, I'm likely to drag in that WP's own cruft along with it. I write in Sigil because I'm not really sure what workflow will result in the cleanest code, other than just doing it in Notepad++. I know from experience that Word and Windows Scrivener (which is basically an RTF editor with extra stuff added in) are not great for this. Any suggestions for this? What do you guys use? 2. I don't see how even its intended use case is helped by randomly choosing whether to add a <p> or a <div> when typing in Book View. I'm sure there's some distinguishing feature, something I'm doing that's causing one to happen instead of the other, but darn if I know what it is. (If I knew what it was, I could avoid it. That'd probably be the best scenario actually, figuring out what I'm doing that triggers it....) Last edited by rodneylives; 06-08-2017 at 01:31 AM. Reason: Adding plea for understanding at end.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
            
| Tags | 
| code, newbie, sigil, stylesheet, tags | 
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Seeking Advice | MicS | Calibre | 5 | 04-18-2013 09:23 AM | 
| Seeking Layout Advice | GrannyGrump | ePub | 8 | 12-13-2012 10:03 AM | 
| Seeking tech advice | wyndslash | Lounge | 13 | 08-26-2011 08:56 PM | 
| Student Seeking advice | Stabiliser | Which one should I buy? | 3 | 04-28-2009 10:33 AM | 
| Yet another noob seeking advice | Voice of Reason | Which one should I buy? | 6 | 04-01-2008 04:49 PM |