How do I make sure every glyph has the same width?

后端 未结 4 1644
不思量自难忘°
不思量自难忘° 2021-01-30 11:59

I\'ve noticed that even at the same font size, there is not a standard width. How can I use these in front of a list of items so the words don\'t appear jagged?

Screensh

4条回答
  •  日久生厌
    2021-01-30 12:59

    Are you sure that you haven't got another style defined that is doing this?

    This is how your HTML looks placed into a file on a site I have using Font Awesome:

    Notice how the icons and the text line up. This is your original image with lines added:

    It looks like you have a style defined somewhere that is removing the Font Awesome styling.

    You could also try adding in the original Font Awesome style (coming from font-awesome.css) to see if that solves it temporarily:

    li [class^="icon-"], .nav li [class^="icon-"], 
    li [class*=" icon-"], .nav li [class*=" icon-"] {
        display: inline-block;
        width: 1.25em;
        text-align: center;
    }
    

提交回复
热议问题