-1

I'm working on a webpage with Github Pages, and I wrote <li> alpha <i>beta</i> </li> in a Markdown file, which is used to create the html page. The following pictures are 1- what I see in the inspect box, while on the page, and 2-What is visible on the webpage. "beta" should be in italic, but isn't formated somehow. Is this a known issue, am I doing something wrong?

One Two

SemAntys
  • 316
  • 2
  • 15

3 Answers3

2

If you wish to get the italic format of text you should use css. According to MDN:

"... A browser will typically still display the contents of the element in italic type, but is, by definition, no longer required to..."

And:

Typically this element is displayed in italic type. However, it should not be used simply to apply italic styling; use the CSS font-style property for that purpose.

you can read more about the i element here.

A. Meshu
  • 4,053
  • 2
  • 20
  • 34
0

use font-style: italic; on element in css styles. this should work best.

DohaHelmy
  • 770
  • 1
  • 7
  • 19
0

The code you've taken a screenshot of will, by default, render <i>beta</i> in italic.

The most likely reason that it hasn't is some CSS setting font-style: normal on the i elements. Possibly this is part of an over-eager global CSS reset that sets * { font-style: normal; }.

Either:

  • Remove the CSS setting that style or
  • Override it for the i element
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335