View Single Post
Old 12-17-2022, 05:40 AM   #6
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 Capricorn View Post
Reading the mozilla reference you gave, I read this under the heading "warning":

If semantically appropriate, i.e., if it represents deleted content, use <del> instead. In all other cases use <s>.

Huh? I am very confused about this statement. According to the epubcheck <del> is correct, not <strike>, not <s>.

I would appreciate it, if someone could clarify this in some way that I can understand.
You can visit the other MDN pages for those explanations:

<strike> was deprecated in HTML4. (For a straight replacement, better to use <s>.)

For <s>, it's probably not that good to use it... but, it stands for:

Quote:
contents that are no longer accurate or no longer relevant.

Note: The s element is not appropriate when indicating document edits; to mark a span of text as having been removed from a document, use the del element.
- - -

Side Note: You can easily also get strikethrough by applying CSS:

Code:
.striketext {
  text-decoration: line-through;
}
- - -

Also, according to MDN, <s>:

Quote:
[...] is not appropriate when indicating document edits; for that, use the <del> and <ins> elements, as appropriate.
So, if you're actually showing DELETED or INSERTED text—like in tracked changes—then...

Use <del> + <ins> instead:

Quote:
The <del> HTML element represents a range of text that has been deleted from a document. This can be used when rendering "track changes" or source code diff information, for example. The <ins> element can be used for the opposite purpose: to indicate text that has been added to the document.
Long story short:

In normal books, you'll probably only ever need to use <s> (or the simple CSS above).

If you are working with some sort of coding book, editing book, or dealing with "tracked changes", then perhaps you may need <ins> + <del>.
Tex2002ans is offline   Reply With Quote