Highlight

Prism is a lightweight, extensible syntax highlighter, built with modern web standards in mind. It’s a spin-off from Dabblet and is tested there daily by thousands.

help

Examples

Introduction

Language Class
HTML language-html
CSS language-css
JavaScript language-javascript
PHP language-php
SQL language-sql
C language-c
C++ language-cpp
Java language-java
PowerShell language-powershell
Python language-python
Find more language and class here.

HTML

                            
<!DOCTYPE html>
<html>
    <head>
        <title>Page Title</title>
    </head>
    <body>

        <h1>This is a Heading</h1>
        <p>This is a paragraph.</p>

    </body>
</html>
                            
                        

CSS

                            
body {
    background-color: #fafafa;
}

h1 {
    color: white;
    text-align: center;
}

p {
    font-family: verdana;
    font-size: 20px;
}
                            
                        

JavaScript

                            
function myFunction(x, y) {
    if (y === undefined) {
        y = 0;
    }    
    return x * y;
}
                            
                        

PHP

                            
<?php
$favcolor = "red";

switch ($favcolor) {
    case "red":
        echo "Your favorite color is red!";
        break;
    case "blue":
        echo "Your favorite color is blue!";
        break;
    case "green":
        echo "Your favorite color is green!";
        break;
    default:
        echo "Your favorite color is neither red, blue, nor green!";
}
?>
                            
                        

SQL

                            
SELECT Customers.CustomerName, Orders.OrderID
FROM Customers
LEFT JOIN Orders
ON Customers.CustomerID=Orders.CustomerID
ORDER BY Customers.CustomerName;