Replace image src location using CSS

后端 未结 4 1478
旧时难觅i
旧时难觅i 2020-12-17 09:40

I have a website that has an image with a src attribute and I would like to change the src location of that image with an image of my own. The image lives in a div component

4条回答
  •  星月不相逢
    2020-12-17 09:59

    You can use a background image

    .application-title img {
      width:200px;
      height:200px;
      box-sizing:border-box;
      padding-left: 200px;
      /*width of the image*/
      background: url(http://lorempixel.com/200/200/city/2) left top no-repeat;
    }

    Original Image:

提交回复
热议问题