I need to center a canvas div on top of an image div. I tried with
#topCanvas {
position:absolute;
left:0;
right:0;
top:0;
bottom:0;
}
and also with left/right-margin but did not succeed. Here is the JSFiddle - http://jsfiddle.net/yesprasoon/dSX7U/1
Canvas width and height will be constant and it needs to align horizontal/vertical centre with the back div. We can safely assume that canvas size will always remain less than the image size.