Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-14-2017, 11: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
Advert
Old 03-14-2017, 11: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: 21,007
Karma: 20776282
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: K4NT, Galaxy Tab 2(RIP)
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
Old 03-14-2017, 12:30 PM   #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, 01: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: 17,271
Karma: 89932658
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 02:32 PM.
DiapDealer is online now   Reply With Quote
Old 03-14-2017, 02: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, 02: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: 17,271
Karma: 89932658
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 online now   Reply With Quote
Old 03-15-2017, 07: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,101
Karma: 480516
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, 08: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, 09: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: 21,007
Karma: 20776282
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: K4NT, Galaxy Tab 2(RIP)
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, 11: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: 1,171
Karma: 12609652
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 11:33 AM.
GrannyGrump is offline   Reply With Quote
Old 03-15-2017, 12:02 PM   #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,397
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
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, 12:54 PM   #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: 17,271
Karma: 89932658
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 online now   Reply With Quote
Old 03-16-2017, 03:55 AM   #13
JustinThought
Zealot
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: 118
Karma: 3500618
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 04:00 AM.
JustinThought is offline   Reply With Quote
Old 03-16-2017, 08: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: 632
Karma: 1771606
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, 10: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: 1,517
Karma: 11627112
Join Date: Dec 2012
Location: Altus, Oklahoma today
Device: iPhone 6/5/iPad 1,2 & Air/Surface Pro/Kindle PW
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 01:55 PM.


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