huhukitty huhukitty -4 years ago 85
CSS Question

CSS - Font for a web based editor

I'm building a web based code editor. I'm currently using

font-family : "Courier New", Courier, monospace


as 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?


Answer Source

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 :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download