i would like to show delete button at top right corner to image? how could i achieve this?
my html is like this :-
main image :
<img id="' + id + '" src="../Images/DefaultPhotoMale.png" class="' + item + '" width="40" height="40" alt="image" title="' + projectTitle + '" style="cursor:pointer" />
x button image to display in top-right of above image
'<img id="' + item.Soid + '" src="../Images/RemoveButton.ico" style="display:none" title="Remove Specialization" />
No background image set please, i need click event for that delete button something like this :
You might try this:
Usual approach with
position: relative
andposition: absolute
.HTML:
CSS:
Extended demo (+ JS interaction) http://jsfiddle.net/yHNEv/
I have coded one up for you http://jsfiddle.net/PPN7Q/
You need to wrap the image in a DIV
and apply the following CSS rules
Please try this. It might help.
Try something like
Demo: Fiddle
In my opinion you can just set
style="position:absolute;top:0px;right:0px;"
forRemoveButton.ico
andstyle="position:relative;"
fordiv
withimg