I have a requirement to achieve a close button as seen in this picture:

But in practice I am able to achieve only this:

I did it with following CSS style. I can’t have the position:absolute since the location of the dialog may change.
margin-right:-10px;
margin-top:-10px;
Any Ideas guys on how could I achieve this?
You need to use z-index and positioning. The simplest way to do this is to have the close button div outside the dialog div and set the z-index of the dialog to a lower number than close button
This web can be useful to you http://tjkdesign.com/articles/z-index/teach_yourself_how_elements_stack.asp
UPDATED http://jsfiddle.net/vj9Wb/