<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Document</title> <style type="text/css"> .inlineDiv{ display:inline-block; float:left; } #holder { width:100%; } </style> <script type="text/javascript"> var colors = new Array("ff0000","00ff00","0000ff","ff00ff","beeeef"); var n = 5; for(var i=0;i<n;i++){ var div = document.createElement('div'); div.className = "inlineDiv"; div.style.backgroundColor = "#" + colors[i]; div.style.width = ($('#holder').width() / n) + "px"; div.style.height = "500px"; document.getElementById('holder').appendChild(div); } </script> </head> <body> <div id="holder"></div> </body> </html>
$(document).ready(function() {});
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)