Search code examples
htmlunicodefractions

How to remove bolding from a fraction that has no entity in HTML


When using the fraction such as 1/8 it is bolded in my browser (latest version of chrome). The HTML code I am using is &frac18 I believe that this is happening because it has no entity, since 1/2, 1/4, and 1/3 display with no issues. How can display this value without bolding?


Solution

  • Since the entity does not exist in all typefaces you may have to select a font where that font does exist and apply a style that forces it show

    p{
      font-family:serif;
    }
    .fraction {
      font-weight:400;
      font-family: verdana;
    }
    <p>here is a line of text</p>
    <p>with some fractions <span class="fraction">&frac18; <span  </p>