JSFiddle - React, Tailwind, and code Playground
HTML
<div id='target'></div>
CSS
#target {
width: 50px;
height: 50px;
background-color: #cfc;
}
JavaScript
$(document).ready(function() {
var cols = new Array('#660', '#606', '#066', '#993', '#939', '#399', '#cc9', '#c9c', '#9cc', '#ffc', '#fcf', '#cff');
for(i = 0; i < 10; i++){
$('#target').append('<div id="new_' + i + '">Hello</div>');
$('#new_' + i)
.position({
my: 'left top',
at: 'left top',
of: '#target',
offset: '' + (i * 20) + ' ' + (i * 10)
})
.css('position', 'absolute')
.width(200)
.height(150)
.css('background-color', cols[i]);
}
});