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 monospaced 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

Example

<div class="w3-code jsHigh">

.. JavaScript code here

</div>
Try It Yourself »

Displaying HTML

Example

<div class="w3-code htmlHigh">

.. HTML code goes here

</div>
Try It Yourself »

Displaying CSS

Example

<div class="w3-code cssHigh">

.. CSS code here

</div>
Try It Yourself »