In CSS: how to specify the font you want as being BOTH monospace and sans-serif?

StackOverflow https://stackoverflow.com/questions/4755203

  •  15-10-2019
  •  | 
  •  

문제

I'd like to tell the browser to use a font that is both monospace and sans-serif (usually the default monospace font has serifs, and the default sans-serif font isnt monospaced). Is there any way to specify this in CSS other than to provide a list of fonts I know to fit my criteria?

도움이 되었습니까?

해결책

CSS's font-family doesn't allow specifying more than one generic font keyword in a single font family name, so you'll either have to go with monospace or sans-serif.

다른 팁

No, you can't say what type of family of font you want. CSS doesn't know if a font has serifs or not.

However, you can just look on here: http://code.google.com/webfonts

And use one of those fonts and it'll work across all browsers.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top