I am trying to get the curved tail to be behind the image, but cannot achieve this. I've tried the z-index and it doesn't work.
.bubble {
  position: relative;
  height: 150px;
  width: 255px;
  margin-right: 5px;
  border-radius: 25px 25px 0 25px;
  border: 2px solid #fff;
  background-image: url(.jpg);
  background-size: contain;
}
.bubble::after {
  content: "";
  position: absolute;
  right: 0;
  background-color: transparent;
  bottom: -50px;
  height: 50px;
  z-index: 0;
  width: 25px;
  border-top-right-radius: 25px;
  box-shadow: 0 -25px 0 0 #fff;
}
<div class="bubble"></div>
                
I am trying to get the curved tail to be behind the image, but cannot achieve this. I've tried the z-index and it doesn't work.
.bubble {
  position: relative;
  height: 150px;
  width: 255px;
  margin-right: 5px;
  border-radius: 25px 25px 0 25px;
  border: 2px solid #fff;
  background-image: url(https://ines-valdovinos.de/images/blog-bubble_teaser.jpg);
  background-size: contain;
}
.bubble::after {
  content: "";
  position: absolute;
  right: 0;
  background-color: transparent;
  bottom: -50px;
  height: 50px;
  z-index: 0;
  width: 25px;
  border-top-right-radius: 25px;
  box-shadow: 0 -25px 0 0 #fff;
}
<div class="bubble"></div>
I've tried z-index 0 and -1 and it does not work.
Here is the solution you need. Please apply this code and test it. Let me know if it doesn't work.
.bubble {
  position: relative;
  height: 150px;
  width: 255px;
  margin-right: 5px;
  border-radius: 25px 25px 0 25px;
  border: 2px solid #fff;
  background-image: url(https://ines-valdovinos.de/images/blog-bubble_teaser.jpg);
  background-size: cover;
  background-position: center;
  z-index: 1;
}
.bubble::after {
  content: "";
    position: absolute;
    z-index: -1;
    bottom: -14px;
    right: -39px;
    width: 29px;
    height: 19px;
    background: #fff;
    -webkit-border-bottom-right-radius: 40px 50px;
    -moz-border-radius-bottomright: 40px 50px;
    border-bottom-left-radius: 66px 50px;
    -webkit-transform: translate(-10px, -2px);
    -moz-transform: translate(-10px, -2px);
    -ms-transform: translate(-10px, -2px);
    -o-transform: translate(-10px, -2px);
    transform: translate(-10px, -2px);
}
.bubble::before {
    content: "";
    position: absolute;
    z-index: -1;
    bottom: -13px;
    right: -14px;
    height: 16px;
    border-right: 30px solid #970d87;
    background: #970d87;
    -webkit-border-bottom-right-radius: 24px 41px;
    -moz-border-radius-bottomright: 80px 50px;
    border-bottom-left-radius: 80px 50px;
    -webkit-transform: translate(0, -2px);
    -moz-transform: translate(0, -2px);
    -ms-transform: translate(0, -2px);
    -o-transform: translate(0, -2px);
    transform: translate(0, -2px);
}
    <div class="bubble"></div>
