how to show delete button in top right corner of Image?

后端 未结 7 1600
予麋鹿
予麋鹿 2021-01-31 17:53

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 :



        
7条回答
  •  余生分开走
    2021-01-31 18:09

    Usual approach with position: relative and position: absolute.

    HTML:

    ×

    CSS:

    .img-wrap {
        position: relative;
        ...
    }
    .img-wrap .close {
        position: absolute;
        top: 2px;
        right: 2px;
        z-index: 100;
        ...
    }
    

    Extended demo (+ JS interaction) http://jsfiddle.net/yHNEv/

提交回复
热议问题