View Single Post
Old 09-30-2020, 07:36 PM   #10
mingsphinx
Junior Member
mingsphinx began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by Turtle91 View Post
No, I wouldn't try and kluge together a different tag <a> just to get a color change...1) eink displays can't display color and 2) it is semantically incorrect.

The <em> tag is specifically designated for text that needs to be emphasized. If you don't define the styling you want for <em> it usually defaults to italics but you can designate the style however you want.

eg
em {color:red; text-decoration:underline}

If the device you are using doesn't respect the publisher's CSS then you could try giving in-line styling *shudder*

eg
<p>This sentence contains an <em style="color:blue">emphasized</em> word.</p>

That doesn't help with non-color displays....so, again, your best bet is to try media queries. Then you can have stuff like:

If this device is an eink:
em {font-weight:bold}

If this device isn't an eink, but can't display color:
em {font-style:italic}

all other devices:
em {color:blue}

with:
<p>This sentence contains an <em>emphasized</em> word.</p>

note: that is not the proper syntax for media queries...just giving the idea...but you can learn a little bit more about how to do them at the W3Schools website.

There is also a Sigil plugin, AddKindleMediaQueries that will add some code to get you started with kindle devices...you will need to figure out the other devices on your own.

Cheers,
Thank you so much. The problem is that there are many eReaders on the market that will completely disregard CSS. Using tags like <em> or <i> will reliably get the machines to display the text in italics just as using <strong> or <b> will produce bold; but styling the <em> tag often fails because the eReaders will disregard the style sheets and only display the text in italics. It is better than using a special class of <p> or <span> because at least there is some change when <em> is used whereas when <p> or <span> is used the result is often nothing.

Without the styling, the final outcome can look very bad, almost unreadable at times. With the proliferation of OLED display cellphones, more and more people are using eReaders on their phones because Dark Mode display, which greatly reduces the phone's energy consumption, affords them hours of reading on a device they already have without having to purchase or carry around another one. The problem is that many of these eReaders will simply disregard CSS, because Dark Mode does require the phone to set its own color scheme, and anyone that relies on CSS to style their work runs the risk of creating the impression among their readers that their work is inferior.

I have found that only the <em> and <i> tags for italics and <strong> and <b> tags for bold are reliably rendered. The <a> tag is also reliable in that it will almost definitely be underlined and possibly made blue if the eReader can display color. But the problem with using the <a> tag is getting the href to refer back to the text that was highlighted as I mentioned above.

The underlying philosophy of what I am trying to do is simply to get to lowest common denominator and create documents that will display the same regardless of eReader.
mingsphinx is offline   Reply With Quote