Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS - Font for a web based editor

Tags:

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?
like image 796
huhukitty Avatar asked Aug 11 '11 12:08

huhukitty


1 Answers

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

like image 132
thirtydot Avatar answered Sep 21 '22 04:09

thirtydot