I'm building a web based code editor. I'm currently using
font-family : "Courier New", Courier, monospace
a开发者_如何学Cs the rule for both line numbers and the source code.
- Does it work on every OS?
- Is there a better font than Courier new that's both targeted towards source code and installed in majority of computers?
Taken from Stack Overflow's CSS:
code {
font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;
}
You can be sure it's been tested :)
The Bootstrap default is:
code {
font-family: Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}
精彩评论