MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   ePub (https://www.mobileread.com/forums/forumdisplay.php?f=179)
-   -   <i>, <em> or <span> for italics ? (https://www.mobileread.com/forums/showthread.php?t=330547)

coneheadZombie 06-07-2020 05:14 AM

<i>, <em> or <span> for italics ?
 
I often see ebooks with all three of the mentioned mode to italicize text in ebooks.

Is there no standard way to do this or can we use any of these modes ?

Doitsu 06-07-2020 06:10 AM

Have a look at the different replies to this StackOverflow post.

JSWolf 06-07-2020 11:06 AM

Quote:

Originally Posted by Doitsu (Post 3997330)
Have a look at the different replies to this StackOverflow post.

Rubbish. I have never seen a single case where <strong> was not bold and <em> was not italic.

j.p.s 06-07-2020 12:48 PM

Quote:

Originally Posted by JSWolf (Post 3997395)
Rubbish. I have never seen a single case where <strong> was not bold and <em> was not italic.

You are not omniscient regarding HTML rendering.

Your dismissal as rubbish is rubbish.

Turtle91 06-07-2020 02:20 PM

I dare say there are more things in heaven and Earth, Jon, than are dreamt of in your philosophy...

...or, in other words.... You don't know what you don't know....

...or, in even more other words... nvm....I think it's been said... ;)


I, personally use <strong>/<em>, with a defining css, to be more semantically correct.

najgori 06-07-2020 02:57 PM

IMHO, if you are designer don't bother. If you are editor, know your craft.

DNSB 06-07-2020 04:12 PM

Quote:

Originally Posted by JSWolf (Post 3997395)
Rubbish. I have never seen a single case where <strong> was not bold and <em> was not italic.

As I mentioned in an earlier post, I ran into one instance where underline was used for <em>. Emphasized is not italic.

JSWolf 06-07-2020 05:16 PM

delete post

JSWolf 06-07-2020 05:26 PM

But you can change the definition of <i> and <b>.

Code:

i {
  font-weight: bold;
  font-style: normal;
  text-decoration: underline;
}
b {
  font-weight: normal;
  font-style: italic;
}


hobnail 06-07-2020 06:49 PM

Can we broaden the question and ask, what about p instead of h?, or my favorite, div instead of p? And I've seen these in recently released books. For too many people who are formatting books the only thing that matters is if it looks good in an ereader.

JSWolf 06-07-2020 07:50 PM

Quote:

Originally Posted by hobnail (Post 3997526)
Can we broaden the question and ask, what about p instead of h?, or my favorite, div instead of p? And I've seen these in recently released books. For too many people who are formatting books the only thing that matters is if it looks good in an ereader.

But it doesn't look good in a lot of cases. And if the code is not good, that makes it more difficult to fix the formatting.

I do not like <div> when <p> should be used. I do not like it when extra useless <div> is used when all that needs to be done is fix the chapter header class. Why do we need a <div> to define the top margin of a chapter when the net like is a <p>? The rule is to keep it simple and I've seen way too many eBooks that do not keep it simple. Remove all unused classes and hundreds of classes are removed. I agree that an <h2> should be used for chapter headers, but I'm not all that bothered enough to swap the <p>. Another thing I dislike is <span> for bold or italic.

But then, I like simple. It's not hard to make an eBook look good and have good code.

Hitch 06-11-2020 05:43 PM

Quote:

Originally Posted by hobnail (Post 3997526)
Can we broaden the question and ask, what about p instead of h?, or my favorite, div instead of p? And I've seen these in recently released books. For too many people who are formatting books the only thing that matters is if it looks good in an ereader.

At some point in time, at some point in space, you'd run into trouble using those, semantically, or for those who are visually impaired using read-aloud, etc. I mean, if you don't tell a heading that it's a heading, it's "wrong" structurally, at the very least. How would it know what to say to the person to whom it's reading? "Big text paragraph?" Rather than heading?

Ditto muddling paragraphs with divs.

Hitch

Turtle91 06-11-2020 11:10 PM

Quote:

Originally Posted by hobnail (Post 3997526)
...For too many people who are formatting books the only thing that matters is if it looks good in an ereader.

There will always be people who don't know the 'right' way to do something, and just 'git er done.

There have to be people in the world that LIKE pushing a wet noodle up a hill, instead of learning to do it the right way.... otherwise we wouldn't have people to laugh at!

JSWolf 06-12-2020 06:18 AM

Quote:

Originally Posted by Hitch (Post 3999084)
At some point in time, at some point in space, you'd run into trouble using those, semantically, or for those who are visually impaired using read-aloud, etc. I mean, if you don't tell a heading that it's a heading, it's "wrong" structurally, at the very least. How would it know what to say to the person to whom it's reading? "Big text paragraph?" Rather than heading?

Ditto muddling paragraphs with divs.

Hitch

I've seen a lot of eBooks that don't quite code the way they should. Most eBooks use <p> for the chapter headers. Most use a <div> to simulate a <blockquote>. Most use a class with <p> where just <p> is appropriate. Some use a <span> for bold and/or italic. So it's no wonder a text-to-speech program cannot get the correct inflections when it doesn't know what it's reading isn't just plain text. Also, using <em> and <strong> (IMHO) is wrong if you just want italic and bold.

Sarmat89 06-12-2020 07:27 AM

h element is useless.
It was intended for manuals, which use hierarchical headers, like
0.1 Introduction
Books, even non-fiction, do not use hierarchical headers; headers in books are complex structures which span several paragraphs. p is the only logical choice.

Also, div is used instead of p to fix the extra space between paragraphs.


All times are GMT -4. The time now is 09:19 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.