View Single Post
Old 09-30-2020, 09:46 PM   #12
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by mingsphinx View Post
The CSS in my EPUB has a class where the color of the text is specified. I then use "<span class="xyz">abc</span>" to define which parts of the text I want highlighted by that color. The problem is that many EPUB readers actually seem to override the font specifications. Is there a way for me to force the reader to use my font specification?
I'm confused:
  • Colors
  • Highlighting
  • Emphasizing
  • Underlining
  • Fonts

What's the ultimate goal here?

Can you show us an example picture of a document and what you're trying to achieve?

Quote:
Originally Posted by mingsphinx View Post
So if I enclose part of the text with the <a> tag, I can at least be certain that the portion marked off will at least be underlined for all users.
<u> is HTML for underline.

If underlining is what you want, that would achieve it. And every single reader/browser in the world would display an underline:

Code:
<p>This is a sentence with <u>underlined</u> text.</p>
Trying to hack links (<a>) to do this is a very, very bad idea.

Quote:
Originally Posted by mingsphinx View Post
The only problem is getting the href to refer to the segment of text itself because if all I do is tell the machine to go to the html file that the segment of text is stored on, anyone clicking on the link will be brought to the start of that page which is frustrating if you are in the middle of it.
... Are you trying to create an actual link? Or emphasizing? Or what?

If you're having trouble getting basic HTML links to work, I believe you're trying to jump too far into the complicated deep-end.

I would highly recommend learning some more of the basics of HTML first:
  • What's a <p> tag?
  • How does <img> work?
  • How does <a> work? What's it used for?

Here's an example I wrote last year about <a>:

Post #3 in "hyperlink endnotes"

I even color coded the parts of a link red+blue in order to explain easier.

Quote:
Originally Posted by Turtle91 View Post
Some readers/devices think they know better how to display a book than the publishers that created them. [...]

Some of those readers/apps have the option to view in "publisher's mode", but that would require the user to select that option. Apart from that, you can't really "force" the reader to follow your css.

The best you can do is keep your css as simple as possible....
Agree completely.

Follow the standards, code your book properly, and then if the user wants to use some crappy CSS-overriding-reader like Moon+, then that's on them.
Tex2002ans is offline   Reply With Quote