<html> <head> <style type="text/css"> body { font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-weight: 300; content: ""; display: inline-block; width: 100%; font-size: 364px; } </style> </head> <body onload="return ran_col()" id="dynamicDiv2" > <div id="dynamicDiv"><span id="dynamicSpan" > <center>JjjL </center></span></div> </body> <script type="text/javascript"> function ran_col() { //function name var color = '#'; // hexadecimal starting symbol var letters = [ 'FF0000','00FF00','0000FF','FFFF00','00FFFF','FF00FF','C0C0C0']; //Set your colors here color += letters[Math.floor(Math.random() * letters.length)]; document.getElementById('dynamicDiv2').style.background = color; // Setting the random color on your div element. } </script> </html>