treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Relative sizes of fonts

  • I recently made a menu which a client had asked for in Calibri. As a fall back font for everyone who doesn't have Calibri I used Trebuchet MS. The thing is, when it falls back to Trebuchet, Trebuchet is bigger and my menu goes nuts, and spills over into a second line.

    Is there any way to add anything to change the padding on my menu when a font isn't detected?

    Thanks! Dave
  • Possibly using JS, but you should ideally try and find a fallback font that has a similar width and x-height to Calibri.
  • Hi Dave,

    Here's a decent font stack for Calibri
    font-family: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;


    And here's one for Trebuchet MS
    font-family: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Tahoma, sans-serif;


    I got these from http://cssfontstack.com/
  • Thanks for these guys. Really appreciate it!