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

后端 未结 7 1613
予麋鹿
予麋鹿 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

    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

    .thumbnail {
    width:50px;
    height:50px;
    position:relative;
    }
    
    .thumbnail img {
    max-width:100%;
    max-height:100%;
    }
    
    .thumbnail a {
    display:block;
    width:10px;
    height:10px;
    position:absolute;
    top:3px;
    right:3px;
    background:#c00;
    overflow:hidden;
    text-indent:-9999px;
    }
    

提交回复
热议问题