您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920212223242526272829
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>ACE in Action</title>
  5. <style type="text/css" media="screen">
  6. #editor {
  7. position: absolute;
  8. top: 0;
  9. right: 0;
  10. bottom: 0;
  11. left: 0;
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <div id="editor">function foo(items) {
  17. var x = "All this is syntax highlighted";
  18. return x;
  19. }</div>
  20. <script src="/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
  21. <script>
  22. var editor = ace.edit("editor");
  23. editor.setTheme("ace/theme/monokai");
  24. editor.session.setMode("ace/mode/javascript");
  25. </script>
  26. </body>
  27. </html>