The Wayback Machine - https://web.archive.org/web/20160912193138/http://www.w3schools.com/w3css/w3css_code.asp
THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML

W3.CSS Code


Displaying Examples

The w3-example class is designed to display examples in a grey container:

Example

  • Jill
  • Eve
  • Adam

Try It Yourself »


Displaying Code

The w3-code class is designed for displaying code.

It displays code with a well readable mono-spaced font.

Example

fruits[0] = "Banana";
fruits[1] = "Apple";
fruits[2] = "Mango";
fruits[3] = "Plum";

Try It Yourself »


Code Coloring

W3Schools provides a JavaScript library for coloring code.

Example

fruits[0] = "Banana";
fruits[1] = "Apple";
fruits[2] = "Mango";
fruits[3] = "Plum";

You can download the library from here: http://www.w3schools.com/lib/w3codecolor.js


Displaying JavaScript

Use the jsHigh class together with w3-code to highlight JavaScript code.

Example

<div class="w3-code jsHigh">

.. JavaScript code here

</div>
Try It Yourself »

Displaying HTML

Use htmlHigh together with w3-code to highlight HTML code.

Example

<div class="w3-code htmlHigh">

.. HTML code goes here

</div>
Try It Yourself »

Displaying CSS

Use cssHigh together with w3-code to highlight CSS code.

Example

<div class="w3-code cssHigh">

.. CSS code here

</div>
Try It Yourself »

Codespan

The w3-codespan class is used to highlight "inline code" with a pink background-color.

Example

<code class="w3-codespan">somecode</code>
Try It Yourself »

Morty Proxy This is a proxified and sanitized view of the page, visit original site.