Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Syntax highlighting

When you add a code example to an article on MDN, it's helpful to enable syntax highlighting, to make it easy for readers to visually pick out relevant bits of the code. Here's how to enable syntax highlighting in code examples:

  1. Type or paste the code into the article. For example:

    void main(int argc, char **argv) {

    printf("Hello world\n");

    }

  2. Select the text and click the PRE icon in the editor toolbar:

    void main(int argc, char **argv) {
    
    printf("Hello world\n");
    
    }
    
  3. Click the Syntax Highlighter icon and select the name of the appropriate programming language for the code example. In this case, it is C/C++:
    void main(int argc, char **argv) {
    
    printf("Hello world\n");
    
    }

Note: The editor does not display the syntax highlighting.  You'll need to preview or save your changes and look at the article to see the syntax highlighting in effect.

Document Tags and Contributors

Tags: 
 Contributors to this page: jswisher
 Last updated by: jswisher,