dvschultz / 99problems

99 Problems and e-reader rendering are all of them
60 stars 3 forks source link

Multiple Stylesheets break anchor links #31

Open dvschultz opened 10 years ago

dvschultz commented 10 years ago

from @makeBetterEBooks here: https://github.com/dvschultz/99problems/issues/22#issuecomment-47493764

Some more fun and games, in ADE 1.7 if multiple CSS sheets are referenced by the same HTML page, internal hyperlinks will go to the top of that HTML page, NOT the specific anchor.

Never did extensive testing, so unsure if it was the presence of multiple CSS sheets, or the fact that the second one was for mobi.

teytag commented 10 years ago

Hi,

My solutions;

screen shot 2014-07-10 at 12 58 26 pm screen shot 2014-07-10 at 12 54 00 pm screen shot 2014-07-10 at 12 56 52 pm

dvschultz commented 10 years ago

@teytag I don’t think this answers the problem: when multiple stylesheets exist, anchor links are broken. This shows you can load multiple stylesheets, but not that anchor links work.

teytag commented 10 years ago

@dvschultz This error may be momentary. I think this error is not multiply sourced stylesheet. Could you show your codes?

JayPanoz commented 8 years ago

It's actually worse… (and it still lives in BlueFire for instance)

Say you've got an HTML file A with a link to another HTML File B:

  1. A.html got one stylesheet, ids are used for callback
  2. B.html got two stylesheets, href points to A.html#id
  3. when you click B.html to go back to A.html#id, you're back at the top of A.html, not at the id.

So it doesn't only impact one HTML file but 2 when 1 of them got multiple stylesheets.

tooolbox commented 8 years ago

@JayPanoz Curious how this relates to #22 and the workaround that it has--putting Media Queries in a separate CSS file. So if you do that, your hyperlinks are toast?

Just want to make sure I understand.

JayPanoz commented 8 years ago

I've actually experienced that this morning for an ePub 3 file as I usually put everything “progressive enhancement” is a separate CSS file. So:

Now, the file with the id got one single stylesheet… only the other one got 2. So it also impacts a file with one stylesheet if the link is in another xhtml file which got 2.

bug