Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-14-2017, 10:46 AM   #1
JackTrade
Member
JackTrade began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Mar 2017
Device: none
Newbie question about <Styles> and tooltips

I frequently run into this problem - trying to implement a style by including the <Style> section inline with the HTML code (Section0001,xhtml), works the way it's supposed to.

Placing the <Style> section in a blank stylesheet (Style0001.css), however, doesn't. For example, trying to form tooltips using code from https://chrisbracco.com/a-simple-css-tooltip/ or from http://netdna.webdesignerdepot.com/u...ltip_demo.html works only when the Style is inline.

I have also encountered this problem with styles unrelated to tooltips.

Any idea why?

Thanks.
JackTrade is offline   Reply With Quote
Old 03-14-2017, 10:55 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,804
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
because, <style> is a special inline tag pair that signifies the contents is a stylesheet

You link stylesheets, the link specifies what type of link

Sigil does all the dirty work for you. Right-click the filename (to link): Select 'Link Stylesheets: TICK all that apply (those that are NOT ticked will unlink): apply

That is it
theducks is offline   Reply With Quote
Advert
Old 03-14-2017, 11:30 AM   #3
JackTrade
Member
JackTrade began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Mar 2017
Device: none
Quote:
Originally Posted by theducks View Post
You link stylesheets, the link specifies what type of link

Sigil does all the dirty work for you. Right-click the filename (to link): Select 'Link Stylesheets: TICK all that apply
It seems to work! Thanks!

I didn't realize that I have to actively link Stylesheets which are part of the same document as the HTML page...
JackTrade is offline   Reply With Quote
Old 03-14-2017, 12:14 PM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,550
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by JackTrade View Post
I didn't realize that I have to actively link Stylesheets which are part of the same document as the HTML page...
Did you, perhaps mean, "part of the same EPUB"? I only ask because you don't have to link styles that are part of the same HTML page. You only have to link stylesheets to html pages when they ARE, in fact, separate documents/files.

Last edited by DiapDealer; 03-14-2017 at 01:32 PM.
DiapDealer is offline   Reply With Quote
Old 03-14-2017, 01:08 PM   #5
JackTrade
Member
JackTrade began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Mar 2017
Device: none
Quote:
Originally Posted by DiapDealer View Post
Did you, perhaps mean, "part of the same EPUB"? I only ask because you don't have to link styles that part of the same HTML page. You only have to link stylesheets to html pages when they ARE, in fact, separate documents/files.
That's exactly what I meant - same EPUB. Just for background - what I did was go to https://chrisbracco.com/a-simple-css-tooltip/, which has separate codes for the HTML and the CSS. I first copied the CSS, opened Sigil and, in a new EPUB, pasted the CSS code in an HTML sheet; went back to the site, copies the HTML code, back to Sigil, pasted the HTML code in the same HTML sheet as the CSS - and it all worked.

Test 2 - created yet another new EPUB in Sigil. Pasted the HTML code in a new HTML sheet; then went to Add/Blank Stylesheet, pasted the CSS code in that new Stylesheet: this time it didn't work.

Finally, using the advice above, went to the HTML sheet, clicked on Link Stylesheets, linked the new Stylesheet - and, lo and behold, it worked again!

As I mentioned, it doesn't make sense to me that Sigil won't do the linking by itself (to Styles in the same EPUB), but this is where it seems to be.
JackTrade is offline   Reply With Quote
Advert
Old 03-14-2017, 01:36 PM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,550
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by JackTrade View Post
As I mentioned, it doesn't make sense to me that Sigil won't do the linking by itself (to Styles in the same EPUB), but this is where it seems to be.
Since an epub can be comprised of numerous html files as well as numerous css files, how on earth would Sigil know which css you wish to apply to which html?
DiapDealer is offline   Reply With Quote
Old 03-15-2017, 06:38 AM   #7
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
Since there are circumstances when your style pointer might not appear in all files (for example, if you split the epub before you think to add the style sheet), you might find it useful to save a working link. This is mine, by way of example:

<link href="../Styles/epub.css" rel="stylesheet" type="text/css"/>
Notjohn is offline   Reply With Quote
Old 03-15-2017, 07:02 AM   #8
JackTrade
Member
JackTrade began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Mar 2017
Device: none
Quote:
Originally Posted by Notjohn View Post
Since there are circumstances when your style pointer might not appear in all files (for example, if you split the epub before you think to add the style sheet), you might find it useful to save a working link.
Sorry, but as a newbie, I have to ask: so you would add this link in each HTML file in the EPUB?
JackTrade is offline   Reply With Quote
Old 03-15-2017, 08:16 AM   #9
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,804
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by JackTrade View Post
Sorry, but as a newbie, I have to ask: so you would add this link in each HTML file in the EPUB?
That needs to use it
Again, Sigil will do that code for you if you don't want to 'type'
theducks is offline   Reply With Quote
Old 03-15-2017, 10:29 AM   #10
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 3,200
Karma: 34977896
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
You might have several CSS stylesheets, and you might not want to use every one on every html file. For instance, you might have a stylesheet named Main.css that you use for each file that is in the body of the book. Then you might have an additional special one named Aux.css that you want to use only for a single html file that contains your Index. Maybe you only have three html files that include images, so you might want another special stylesheet named Pics.css containing only stylings for your illustrations, so you could link that one only to those three html files. Etc, etc, etc.

Each (x)html file can be linked to multiple stylesheets.

Last edited by GrannyGrump; 03-15-2017 at 10:33 AM.
GrannyGrump is offline   Reply With Quote
Old 03-15-2017, 11:02 AM   #11
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by JackTrade View Post
As I mentioned, it doesn't make sense to me that Sigil won't do the linking by itself (to Styles in the same EPUB), but this is where it seems to be.
Perhaps it makes sense if I tell you that you can have multiple stylesheets. Sometimes it is easier to have stylesheets separate for certain HTML files. If they were automatically linked, it can cause strange effects. Some pages don't need a stylesheet at all.
Toxaris is offline   Reply With Quote
Old 03-15-2017, 11:54 AM   #12
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,550
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Toxaris View Post
Perhaps it makes sense if I tell you that you can have multiple stylesheets. Sometimes it is easier to have stylesheets separate for certain HTML files. If they were automatically linked, it can cause strange effects. Some pages don't need a stylesheet at all.
And since Sigil has no idea if the css file you just added is the one-and-only, or only the first-of-many, it wouldn't make sense to automatically link it to every html file.
DiapDealer is offline   Reply With Quote
Old 03-16-2017, 02:55 AM   #13
JustinThought
Groupie
JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.
 
JustinThought's Avatar
 
Posts: 171
Karma: 3517858
Join Date: May 2016
Location: Monterrey, Mexico
Device: Samsung Tab-3 7"
Quote:
Originally Posted by DiapDealer View Post
And since Sigil has no idea if the css file you just added is the one-and-only, or only the first-of-many, it wouldn't make sense to automatically link it to every html file.
I've got that going on in something I'm working on now. I have a specific style I've gotten from somewhere else on this forum, and during testing I placed it into a separate stylesheet (for some reason--it seemed to be the thing to do at the time). That style is used in only about five or six chapters out of the book, so I have only linked that sheet to those chapters.

So my question is, is there a speed issue here? Could linking that unused stylesheet--or copying those specific styles into my main stylesheet--cause some slowdown in the overall epub? --Or the inverse, could copying that style into my main stylesheet and deleting the "extra" one speed up the the process?

I've been curious about this because my I re-use the same stylesheet in every epub I do, and it has styles that are often not used in that specific book. And I don't go out of my way to delete the unused styles at the end of development. So am I setting a little "time"-bomb here?

Last edited by JustinThought; 03-16-2017 at 03:00 AM.
JustinThought is offline   Reply With Quote
Old 03-16-2017, 07:58 AM   #14
exaltedwombat
Guru
exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.
 
Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
Have you ever experienced an eBook that you felt responded particularly slowly?
exaltedwombat is offline   Reply With Quote
Old 03-16-2017, 09:19 AM   #15
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by exaltedwombat View Post
Have you ever experienced an eBook that you felt responded particularly slowly?
Most definitely...but they were ones that were immense...50mb or so (if I remember correctly) and filled with a ton of junk code (bloat). After I cleaned it up it was a much more manageable size - just under 2mb - and was quite spry.

As far as extra css files slowing it down: Yes. Any extra action that the app has to take will slow it down...be it from opening extra css sheets or wading through bloated inline styles/spans...but we're talking micro-seconds here for opening a css sheet. There would need to be a ton of css's linked to each html to make it noticeable. In this particular case having a few extra css sheets shouldn't slow it down noticeably because they are only referenced on the few pages that need them and would only be accessed by the app when those html files are opened.

Having said all that, I find that having all my css on a single sheet makes it easier for me to keep myself organized. I would get confused if there were multiple sheets, and possibly different sheets using the same names. *shudder*

I keep all of my standard css at the top of the sheet and then book specific styles at the bottom where they would override the standard style higher on the sheet. After I'm done editing, I use the "Delete Unused Stylesheet Classes" tool to...um... delete unused stylesheet classes and leave my CSS sheet as tidy as possible. note: when using this tool carefully check the list before deleting - it sometimes doesn't pick up on pseudo-elements being used properly.
Turtle91 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Epub styles question nqk ePub 4 04-20-2015 05:26 AM
How to turn off tooltips? ktenney Calibre 8 01-23-2015 09:19 AM
Disable tooltips? jhalpin Library Management 7 06-08-2014 12:14 PM
Question: paragraph spacing and CSS styles rhino79 ePub 3 05-06-2013 05:06 PM


All times are GMT -4. The time now is 11:42 AM.


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