Is it possible to make certain parts of an image transparent in HTML5/CSS

前端 未结 2 1830
Happy的楠姐
Happy的楠姐 2021-01-15 21:29

I want to have an image on my page that has certain parts that are transparent, but not all of it. Is it possible to make just certain parts of an image/div transparent? For

2条回答
  •  生来不讨喜
    2021-01-15 21:50

    DEMO

    Check this Demo, you can do by adding a span tag and give absolute position add opacity. and also you can increase the opacity. Hope this is the one you are looking for. :)

    html :

    CSS:

    .imgWrap img{
        width:80%;
        height:80%;
        position:relative;
        border:1px solid #900;
    }
    .tranparentClass {
        opacity:.5;
        border:1px solid #f00;
        border-radius : 50%;
        display:block;
        padding:55px;
        position:absolute;
        top:0;
        left:0;
        background:#fff;
    
    }
    

提交回复
热议问题